pyfiglet: Pure-Python FIGlet Implementation

1.0.4 · active · verified Thu Apr 09

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]

Warnings

Install

Imports

Quickstart

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]

import pyfiglet

# Render text using the default font
text_default = pyfiglet.figlet_format("Hello, World!")
print(text_default)

# Render text using a specific font (e.g., 'slant')
text_slant = pyfiglet.figlet_format("Pyfiglet", font="slant")
print(text_slant)

# List available fonts (optional)
# Uncomment to see a long list
# fig = pyfiglet.Figlet()
# print(fig.getFonts())

view raw JSON →