{"id":2217,"library":"pyfiglet","title":"pyfiglet: Pure-Python FIGlet Implementation","description":"pyfiglet is a pure-Python port of FIGlet, a program that generates ASCII art from text. It enables dynamic rendering of text in various ASCII art fonts within Python applications or via the command line interface. The library is actively maintained, with recent releases focusing on bug fixes, type hinting, and Python version compatibility. [1, 3, 9]","status":"active","version":"1.0.4","language":"en","source_language":"en","source_url":"https://github.com/pwaller/pyfiglet","tags":["text-processing","cli","ascii-art","figlet","typography","pure-python"],"install":[{"cmd":"pip install pyfiglet","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"While a 'Figlet' class exists, the `pyfiglet.figlet_format` function is the most common and direct way to render text, as shown in most examples. The `Figlet` class might be for more advanced or older use cases. [1, 2, 6, 10]","wrong":"from pyfiglet import Figlet","symbol":"figlet_format","correct":"import pyfiglet\nresult = pyfiglet.figlet_format(\"Hello\")"}],"quickstart":{"code":"import pyfiglet\n\n# Render text using the default font\ntext_default = pyfiglet.figlet_format(\"Hello, World!\")\nprint(text_default)\n\n# Render text using a specific font (e.g., 'slant')\ntext_slant = pyfiglet.figlet_format(\"Pyfiglet\", font=\"slant\")\nprint(text_slant)\n\n# List available fonts (optional)\n# Uncomment to see a long list\n# fig = pyfiglet.Figlet()\n# print(fig.getFonts())","lang":"python","description":"This quickstart demonstrates how to use `pyfiglet.figlet_format` to convert a string into ASCII art using either the default font or a specified font. It also includes an optional snippet to list all available fonts. [2, 4, 6]"},"warnings":[{"fix":"Ensure your Python environment is 3.9 or newer. For older Python versions, explicitly install `pyfiglet<1`.","message":"Versions 1.0.0 and above drop support for Python versions older than 3.9. If you need Python <= 3.7 support, you must use `pyfiglet<1`. Version 1.0.0 was initially yanked due to compatibility issues with older Python versions. [3]","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"If a desired font is missing, search for 'figlet fonts' online. Some external fonts can be loaded via the command line interface: `pyfiglet -L <font_file>`. [1]","message":"Some fonts that were previously available in older `pyfiglet` distributions (or the original C `FIGlet`) have been removed due to distribution rights. Users expecting specific fonts might find them missing. [1, 5]","severity":"gotcha","affected_versions":"All versions >=1.0.0"},{"fix":"Use the `--collect-all pyfiglet` option with PyInstaller (e.g., `pyinstaller -F --collect-all pyfiglet your_script.py`). [15]","message":"When bundling applications with PyInstaller, `pyfiglet` fonts might not be automatically included, leading to `ModuleNotFoundError: No module named 'pyfiglet.fonts'` errors at runtime. [15]","severity":"gotcha","affected_versions":"All versions"},{"fix":"For complex or custom rendering scenarios, thorough testing of the output is recommended.","message":"The internal code for kerning, mushing, and rendering is described as \"fragile and complex.\" While this primarily affects contributors modifying the core logic, it suggests potential for unexpected behavior with highly customized inputs or unusual fonts. [1, 5, 8]","severity":"gotcha","affected_versions":"All versions"},{"fix":"Monitor the GitHub issue tracker for a resolution. If encountered, try pinning an older `setuptools` version or isolating `pyfiglet` in a dedicated virtual environment.","message":"An open issue indicates potential incompatibility where `pyfiglet` might break with `setuptools >= 82`. This could lead to installation or runtime errors in environments with newer `setuptools` versions. [14]","severity":"gotcha","affected_versions":"Potentially current and future versions with `setuptools >= 82`"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}