a Python transpilation of @zwyx ’s Library of Babel: mainly a CLI with limited multi-language input support
for personal fun and also coding challenge
see ABOUT for more details about my exploration journey
see DETAILS for technical details about this implementation
this program is STILL INTENDED FOR PYTHON DEVELOPERS: dependencies installation isn’t trivial for end users
- this program is built upon https://github.com/zwyx/library-of-babel
- also partially inspired from https://github.com/tdjsnelling/babel by Tom Snelling
- don’t forget the original work of https://github.com/librarianofbabel/libraryofbabel.info-algo by Jonathan Basile
all illustrations in this repo are just links to the website of Jonathan Basile and Tom Snelling
- Python version ≥ 3.14 (free-threading not required)
- General Multi-Precision (GMP) arithmetic:
gmpy2: to crunch very big number - International Components for Unicode (ICU):
pyicu: to deal with unicode inputs- windows wheels can be downloaded from: https://github.com/cgohlke/pyicu-build/releases
- linux need
libicu-devor the like - mac need
icu4c
- optional
pillowto output image - optional
fpdf2to output pdf, usingJuliaMonotypeface from https://github.com/cormullion/juliamono
command example on my machine (windows):
pip install pillow gmpy2 fpdf2 https://github.com/cgohlke/pyicu-build/releases/download/v2.16.2/pyicu-2.16.2-cp314-cp314-win_amd64.whlcommand example on Linux or Mac (conda may be easier):
pip install pillow gmpy2 fpdf2 pyicui include a text file that u can use to test the program
python -m urbabel.cli search -i docs/3-EXTRA.md -o tmp/book-1.txt -save-pos -save-img -save-pdfon my computer, process a book take ~3s, then save to .png take ~2s, RAM usage < 200 MiB
RECOMMENDATION: use a modern monospace file to properly render all characters, like JuliaMono, Fira Code, Iosevka, etc.
COMPATIBILITY: see https://github.com/unicode-org/last-resort-font
extra 1: to generate books in your own language without latin characters: edit:
extra 2: to change font in PDF output: edit path to font file in pdf.py
(not in any particular order)
- TXT / PNG / PDF input / output
- setup github / gitlab ci/cd to automate testing
- better user interface: text / graphical / web
- verify the number of characters filtered:
81758145 in book content,149625159613 in book id -
GPU acceleration for base conversionmaybe not really necessary -
Julia version ?not worth the effort at the moment


