Art
π¨ ASCII art library for Python
Install / Use
/learn @sepandhaghighi/ArtREADME
Overview
ASCII art is also known as "computer text art". It involves the smart placement of typed special characters or letters to make a visual shape that is spread over multiple lines of text.
ART is a Python lib for text converting to ASCII art fancy. ;-)
<table> <tr align="center"> <td>Open Hub</td> <td><a href="https://www.openhub.net/p/artlib"><img src="https://www.openhub.net/p/artlib/widgets/project_thin_badge.gif"></a></td> </tr> <tr align="center"> <td>PyPI Counter</td> <td><a href="https://pepy.tech/projects/art"><img src="https://static.pepy.tech/badge/art" alt="PyPI Downloads"></a></td> </tr> <tr align="center"> <td>Github Stars</td> <td><a href="https://github.com/sepandhaghighi/art"><img src="https://img.shields.io/github/stars/sepandhaghighi/art.svg?style=social&label=Stars"></a></td> </tr> <tr align="center"> <td>Font Counter</td> <td id="font_counter">677</td> </tr> <tr align="center"> <td>1-Line-Art Counter</td> <td id="art_counter">711</td> </tr> <tr align="center"> <td>Decor Counter</td> <td id="decor_counter">218</td> </tr> </table> <table> <tr> <td align="center">Branch</td> <td align="center">master</td> <td align="center">dev</td> </tr> <tr> <td align="center">CI</td> <td align="center"><img src="https://github.com/sepandhaghighi/art/actions/workflows/test.yml/badge.svg?branch=master"></td> <td align="center"><img src="https://github.com/sepandhaghighi/art/actions/workflows/test.yml/badge.svg?branch=dev"></td> </tr> </table> <table> <tr> <td align="center">Code Quality</td> <td align="center"><a class="badge-align" href="https://www.codacy.com/app/sepand-haghighi/art?utm_source=github.com&utm_medium=referral&utm_content=sepandhaghighi/art&utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/405020450bc94088ad1450461831a587"/></a></td> <td align="center"><a href="https://codebeat.co/projects/github-com-sepandhaghighi-art-dev"><img alt="codebeat badge" src="https://codebeat.co/badges/90e77325-a046-4cc5-9c3e-646c011a5b72" /></a></td> <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/art"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/art/badge" alt="CodeFactor" /></a></td> </tr> </table>Usage
<div align="center"> <img src="https://github.com/sepandhaghighi/art/raw/master/otherfile/ART.gif"> <p>Quick Start</p> </div>1-Line art
β οΈ Some environments don't support all 1-Line arts
β οΈ ART 4.6 is the last version to support Bipartite art
1. art
This function return 1-line art as str in normal mode and raise artError in exception.
>>> from art import *
>>> art_1=art("coffee") # return art as str in normal mode
>>> print(art_1)
c[_]
>>> art_2=art("woman",number=2) # return multiple art as str
>>> print(art_2)
ββ_ββ ββ_ββ
>>> art("coffee", number=3, space=5)
'c[_] c[_] c[_]'
>>> art("random") # random 1-line art mode
'(γ£ββΏβ)γ£ '
>>> art("rand") # random 1-line art mode
't(-_-t) '
>>> art(22,number=1) # raise artError
Traceback (most recent call last):
...
art.art.artError: The 'artname' type must be str.
2. aprint
This function print 1-line art in normal mode (return None) and raise artError in exception.
>>> aprint("butterfly") # print art
ΖΈΜ΅Μ‘ΣΜ΅Μ¨ΜΖ·
>>> aprint("happy") # print art
Ϋ\(οΪΊοΩ` )/Ϋ
>>> aprint("coffee", number=3, space=5)
c[_] c[_] c[_]
>>> aprint("random") # random 1-line art mode
'(γ£ββΏβ)γ£ '
>>> aprint("rand") # random 1-line art mode
't(-_-t) '
>>> aprint("woman",number="22") # raise artError
Traceback (most recent call last):
...
art.art.artError: The 'number' type must be int.
3. randart
randart function is added in Version 2.2 as art("random") shortcut.
>>> randart()
'ααββα½ β¬βΉβΚαα¬αα½ '
>>> randart()
'β(ββΏ-)β '
βΉοΈ Use ART_NAMES to access all arts name list (new in Version 4.2)
βΉοΈ Use NON_ASCII_ARTS to access all Non-ASCII arts name list (new in Version 4.6)
βΉοΈ Use ASCII_ARTS to access all ASCII arts name list (new in Version 5.7)
ASCII text
β οΈ Some fonts don't support all characters
β οΈ From Version 3.3 Non-ASCII fonts added (These fonts are not compatible with some environments)
β οΈ From Version 5.3 \n is used as the default line separator instead of \r\n (Use sep parameter if needed)
1. text2art
This function return ASCII text as str in normal mode and raise artError in exception.
>>> Art=text2art("art") # Return ASCII text (default font) and default chr_ignore=True
>>> print(Art)
_
__ _ _ __ | |_
/ _` || '__|| __|
| (_| || | | |_
\__,_||_| \__|
>>> Art=text2art("art",font='block',chr_ignore=True) # Return ASCII text with block font
>>> print(Art)
.----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. |
| | __ | || | _______ | || | _________ | |
| | / \ | || | |_ __ \ | || | | _ _ | | |
| | / /\ \ | || | | |__) | | || | |_/ | | \_| | |
| | / ____ \ | || | | __ / | || | | | | |
| | _/ / \ \_ | || | _| | \ \_ | || | _| |_ | |
| ||____| |____|| || | |____| |___| | || | |_____| | |
| | | || | | || | | |
| '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------'
>>> Art=text2art("test","random") # random font mode
>>> print(Art)
| |
~|~/~/(~~|~
| \/__) |
>>> Art=text2art("test","rand") # random font mode
>>> print(Art)
___ ____ ____ ___
| |___ [__ |
| |___ ___] |
>>> print(text2art("test", space=10))
_ _
| |_ ___ ___ | |_
| __| / _ \ / __| | __|
| |_ | __/ \__ \ | |_
\__| \___| |___/ \__|
>>> print(text2art('''Lorem
ipsum
dolor''', font="small")) # Multi-line print
_
| | ___ _ _ ___ _ __
| |__ / _ \| '_|/ -_)| ' \
|____|\___/|_| \___||_|_|_|
_
(_) _ __ ___ _ _ _ __
| || '_ \(_-<| || || ' \
|_|| .__//__/ \_,_||_|_|_|
|_|
_ _
__| | ___ | | ___ _ _
/ _` |/ _ \| |/ _ \| '_|
\__,_|\___/|_|\___/|_|
>>> print(text2art("test","white_bubble")) # Non-ASCII font example
β£ββ’β£
>>> text2art("art",font="fancy5",decoration="barcode1") # decoration parameter is added in Version 4.6
'ββββββββ ααα ββββββββ'
>>> text2art("seΨ³Ψ³Ψ³",font=DEFAULT_FONT,chr_ignore=False) # raise artError in exception
Traceback (most recent call last):
...
art.art.artError: Ψ³ is invalid.
2. tprint
This function print ASCII text in normal mode (return None) and raise artError in exception.
>>> tprint("art") # print ASCII text (default font)
_
__ _ _ __ | |_
/ _` || '__|| __|
| (_| || | | |_
\__,_||_| \__|
>>> tprint("art",font="block",chr_ignore=True) # print ASCII text (block font)
.----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. |
| | __ | || | _______ | || | _________ | |
| | / \ | || | |_ __ \ | || | | _ _ | | |
| | / /\ \ | || | | |__) | | || | |_/ | | \_| | |
| | / ____ \ | || | | __ / | || | | | | |
| | _/ / \ \_ | || | _| | \ \_ | || | _| |_ | |
| ||____| |____|| || | |____| |___| | || | |_____| | |
| | | || | | || | | |
| '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------'
>>> tprint('testΨ³Ψ³') # chr_ignore flag ==True (Default)
_ _
| |_ ___ ___ | |_
| __| / _ \/ __|| __|
| |_ | __/\__ \| |_
\__| \___||___/ \__|
>>> tprint("test","random") # random font mode
| |
~|~/~/(~~|~
| \/__) |
>>> tprint("test","rand
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
84.2kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
340.5kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
