ASCII Art Library For Python

6.5 · active · verified Sun Apr 12

ART is a Python library for converting text to ASCII art and generating 1-line ASCII art. It's currently at version 6.5 and is actively maintained with frequent releases, adding new fonts and features, and dropping support for older Python versions.

Warnings

Install

Imports

Quickstart

Demonstrates converting a string to multi-line ASCII art using a specified font and generating a random 1-line ASCII art.

from art import text2art
from art import art

# Convert text to ASCII art
ascii_text = text2art("Hello, World!", font="block")
print(ascii_text)

# Generate a 1-line ASCII art
one_line_art = art("coffee")
print(one_line_art)

# Example of using a non-default font for 1-line art (if supported)
# try:
#     fancy_art = art("random", font="hideki") # Note: 'random' often doesn't use font arg explicitly
#     print(fancy_art)
# except Exception as e:
#     print(f"Could not generate fancy art: {e}")

view raw JSON →