pyfiglet renders plain text into ASCII art fonts in Python, matching FIGlet output without calling an external binary. It works as an importable library and as a command-line tool.
Overview
pyfiglet is a Python port of FIGlet. It accepts ASCII text and draws it using FIGlet font files, so banners and titles can be generated from strings inside Python programs or from a shell.
The library exists so figlet-style rendering can run in-process rather than spawning the original C FIGlet executable, while still supporting command-line use with options similar to figlet. Font collections can live in a single zip archive. Kerning and smushing behavior is intended to match FIGlet; mismatches are treated as bugs.
You can call figlet render functions from code or invoke the pyfiglet CLI, typically choosing a font with -f while defaulting to standard.flf. Additional fonts install via the CLI from single font files or zip bundles. On Unix-like systems it can also use fonts already installed for FIGlet under standard share paths.
Distribution splits fonts with clear redistribution licenses from contributed sets where legal status is less certain; some fonts were removed when distribution rights were unclear. Toilet .tlf fonts were imported from the toilet project. Compared with FIGlet, the main addition called out in the docs is zip-based font packaging alongside embedded Python use.
Key features
- FIGlet-compatible ASCII art output
- In-process Python library API
- Command-line rendering
- Kerning and smushing support
- Font install from files or zips
- Uses system FIGlet font paths on Unix
- Toilet .tlf font support
Use cases
- Terminal banners and titles
- Embedded text art in Python apps
- CLI splash output
- Scripts avoiding external figlet binary
- Custom font collections in zip files