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]
pip install pyfigletVerified import paths — ran on the pinned version, not inferred.
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]
Ensure your Python environment is 3.9 or newer. For older Python versions, explicitly install `pyfiglet<1`.
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]
Use the `--collect-all pyfiglet` option with PyInstaller (e.g., `pyinstaller -F --collect-all pyfiglet your_script.py`). [15]
For complex or custom rendering scenarios, thorough testing of the output is recommended.
Monitor the GitHub issue tracker for a resolution. If encountered, try pinning an older `setuptools` version or isolating `pyfiglet` in a dedicated virtual environment.
Run `pip install pyfiglet` in your terminal to install the library, ensuring you are in the correct Python environment if you use virtual environments.
Rename your Python script file to something other than `pyfiglet.py` or `figlet.py` (e.g., `my_ascii_art.py`) to avoid conflicting with the library's module name.
Pass the font name using the `font` keyword argument: `figlet.setFont(font='slant')` or `figlet.setFont(font=random.choice(figfonts))`.
Include the `pyfiglet.fonts` module explicitly using PyInstaller's `--hidden-import` option: `pyinstaller --hidden-import pyfiglet.fonts your_script.py`.
Verify the font name is correct and available by checking `pyfiglet.Figlet().getFonts()` or choose a standard font. If a specific removed font is desired, you may need to find and install it manually.
No dependency data recorded yet.