sepandhaghighi
art
Python

🎨 ASCII art library for Python

Last updated Jul 5, 2026
2.5k
Stars
156
Forks
11
Issues
+2
Stars/day
Attention Score
77
Language breakdown
No language data available.
Files click to expand
README

Logo

Codecov PyPI built with Python3 GitHub repo size Font List Art List Decor List Telegram Bot Anaconda Discord Channel

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. ;-)
Open Hub
PyPI Counter PyPI Downloads
Github Stars
Font Counter 677
1-Line-Art Counter 711
Decor Counter 218
Branch master dev
CI
Code Quality codebeat badge CodeFactor

Usage

Quick Start

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  ۜ\(סּںסּَ )/ۜ &gt;&gt;&gt; aprint(&quot;coffee&quot;, number=3, space=5)  c[]     c[]     c[_]  &gt;&gt;&gt; aprint(&quot;random&quot;) # random 1-line art mode &#39;(っ◕‿◕)っ &#39; &gt;&gt;&gt; aprint(&quot;rand&quot;)   # random 1-line art mode &#39;t(-_-t) &#39; &gt;&gt;&gt; aprint(&quot;woman&quot;,number=&quot;22&quot;) # raise artError Traceback (most recent call last):         ... art.art.artError: The &#39;number&#39; type must be int.</code></pre>

3. randart

randart function is added in Version 2.2 as art("random") shortcut. <pre><code class="lang-pycon">&gt;&gt;&gt; randart() &#39;ዞᏜ℘℘Ꮍ ℬℹℛʈዞᗬᏜᎽ &#39; &gt;&gt;&gt; randart() &#39;✌(◕‿-)✌ &#39;</code></pre>

ℹ️ Use ART_NAMES to access all arts name list (new in Version 4.2)

ℹ️ Use NONASCIIARTS 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. <pre><code class="lang-pycon">&gt;&gt;&gt; Art=text2art(&quot;art&quot;) # Return ASCII text (default font) and default chr_ignore=True &gt;&gt;&gt; print(Art) _ | |_ / _ || '|| | | (| || | | | \,||| \| >>> Art=text2art("art",f,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''', f)) # Multi-line print _ | | _ | |_ / \| '|/ -)| ' \ |_|\/|| \_||||| _ () __ | || ' \(-<| || || ' \ ||| ./// \,||||| |_| | | | | _ _ / |/ \| |/ \| &#39;| \,|\/||\_/||

&gt;&gt;&gt; print(text2art(&quot;test&quot;,&quot;white_bubble&quot;)) # Non-ASCII font example ⓣⓔⓢⓣ &gt;&gt;&gt; text2art(&quot;art&quot;,f,decoration=&quot;barcode1&quot;) # decoration parameter is added in Version 4.6 &#39;▌│█║▌║▌║ ᏗᏒᏖ ║▌║▌║█│▌&#39; &gt;&gt;&gt; text2art(&quot;seسسس&quot;,font=DEFAULTFONT,chrignore=False) # raise artError in exception Traceback (most recent call last): ... art.art.artError: س is invalid.</code></pre>

2. tprint

This function print ASCII text in normal mode (return None) and raise artError in exception. <pre><code class="lang-pycon">&gt;&gt;&gt; tprint(&quot;art&quot;) # print ASCII text (default font) _ | |_ / _ || '|| | | (| || | | | \,||| \|

>>> tprint("art",f,chr_ignore=True) # print ASCII text (block font)

.----------------. .----------------. .----------------. | .--------------. || .--------------. || .--------------. | | | | || | | || | __ | | | | / \ | || | | \ | || | | _ | | | | | / /\ \ | || | | |_) | | || | |/ | | \_| | | | | / __ \ | || | | / | || | | | | | | | / / \ \ | || | | | \ \ | || | | | | | | ||_| ||| || | || || | || | |_| | | | | | || | | || | | | | '--------------' || '--------------' || '--------------' | '----------------' '----------------' '----------------'

>>> tprint('testسس') # chr_ignore flag ==True (Default) | | | | | | / \/ || _| | | | /\ \| | \| \||/ \| >>> tprint("test","random") # random font mode | | ~|~/~/(~~|~ | \/__) | >>> tprint("test","rand") # random font mode | |_ [ | | | ] | >>> tprint("test", space=10) | | | | | | / \ / | | _| | | | / \ \ | | \| \| |/ \| >>> tprint('testسس',chr_ignore=False) # raise artError in exception Traceback (most recent call last): ... art.art.artError: س is invalid. >>> tprint('''Lorem ipsum dolor''', f) # Multi-line print _ | | | |/ |_ |\/| | || | \ |__ | | _ _ | |] [ | | |\/| | | _] || | | __ | \ | | | | | |__/ |/ || |_ || | \

>>> tprint("art",f,decoration="barcode1") # decoration parameter is added in Version 4.6 ▌│█║▌║▌║ ᏗᏒᏖ ║▌║▌║█│▌ >>> tprint("art",f,decoration="random") # decoration random mode is added in Version 5.0 •]•·✦º✦·»ᏗᏒᏖ«·✦º✦·•[•

3. tsave

This function return dict in normal and exception mode.

>>> Response=tsave("art",filename="test.txt") # save ASCII text in test.txt file with save message (print_status==True), return dict Saved!  Filename: test.txt >>> Response["Message"] 'OK' >>> Response=tsave("art",filename="test.txt",printstatus=False) # save ASCII text in test.txt file without save message (printstatus==False) >>> Response["Message"] 'OK' >>> Response["Status"] True >>> tsave(22,font=DEFAULTFONT,filename="art",chrignore=True,print_status=True) {'Status': False, 'Message': "'int' object has no attribute 'split'"} >>> Response=tsave("art",filename="test.txt",overwrite=True) # overwrite parameter is added in Version 4.0 Saved!  Filename: test.txt >>> Response=tsave("art",filename="test.txt",decoration="barcode1") # decoration parameter is added in Version 4.6 Saved!  Filename: test.txt >>> Response=tsave("art",filename="test.txt",sep="\r\n") # sep parameter is added in Version 5.3 Saved!  Filename: test.txt                         >>> Response=tsave("art",filename="test.txt",space=5) # space parameter is added in Version 6.0 Saved!  Filename: test.txt

ℹ️ Use FONT_NAMES to access all fonts name list (new in Version 4.2)

ℹ️ Use NONASCIIFONTS to access all Non-ASCII fonts name list (new in Version 4.4)

ℹ️ Use ASCII_FONTS to access all ASCII fonts name list (new in Version 5.7)

Line

1. lprint

This function prints a grid (length by height) of any given character in normal mode and raise artError in exception.

>>> lprint(length=15, height=2, char="*") 
*

ℹ️ New in Version 6.4

ℹ️ The default values are length=15, height=1, char='#'

2. line

This function returns a grid (length by height) of any given character as str in normal mode and raise artError in exception.

>>> line(length=15, height=2, char="*") '\n'

ℹ️ New in Version 6.4

ℹ️ The default values are length=15, height=1, char='#'

Decoration

⚠️ Some environments don't support all decorations

1. decor

This function return decoration as str in normal mode and raise artError in exception.

>>> decor("barcode1") '▌│█║▌║▌║ ' >>> decor("barcode1",reverse=True) ' ║▌║▌║█│▌' >>> decor("barcode1") + text2art("    art   ",f) + decor("barcode1",reverse=True) '▌│█║▌║▌║     ąяţ    ║▌║▌║█│▌' >>> decor("barcode1",both=True) # both parameter is added in Version 5.0 ['▌│█║▌║▌║ ', ' ║▌║▌║█│▌'] >>> decor("random",both=True) # random mode is added in Version 5.0 ['「(◔ω◔「)三', '三三三ʅ(;◔౪◔)ʃ'] >>> decor("rand",both=True) # random mode is added in Version 5.0 ['‹–…·´·…–›&#39;, &#39;‹–…·´·…–›'] >>> decor(None) Traceback (most recent call last): 	... art.art.artError: The 'decoration' type must be str.

ℹ️ Use DECORATION_NAMES to access all decorations name list (new in Version 4.6)

Font modes

These modes are available for text2art, tprint & tsave.

1. Font name

⚠️ Some fonts don't support all characters

>>> tprint("art",f,chr_ignore=True)

.----------------. .----------------. .----------------. | .--------------. || .--------------. || .--------------. | | | | || | | || | __ | | | | / \ | || | | \ | || | | _ | | | | | / /\ \ | || | | |_) | | || | |/ | | \_| | | | | / __ \ | || | | / | || | | | | | | | / / \ \ | || | | | \ \ | || | | | | | | ||_| ||| || | || || | || | |_| | | | | | || | | || | | | | '--------------' || '--------------' || '--------------' | '----------------' '----------------' '----------------'

>>> tprint("art","white_bubble") ⓐⓡⓣ

2. Random

Randomly select from all fonts.

Keywords : random, rand & rnd

>>> tprint("test",f)
 |       | 
~|~/~/(~~|~
 | \/__) |

3. Random small

Randomly select from small fonts.

Keywords : rnd-small, random-small & rand-small

ℹ️ New in Version 2.8

>>> tprint("test",f)
             
/      / 
/  (- _)  /

4. Random medium

Randomly select from medium fonts.

Keywords : rnd-medium, random-medium & rand-medium

ℹ️ New in Version 2.8

>>> tprint("test",f)
                      
  ,                ,  
 ||               ||  
=||=  -   -, =||= 
 ||  || \\ ||_.   ||  
 ||  ||/    ~ ||  ||  
 \\, \\,/  ,-_-   \\,

5. Random large

Randomly select from large fonts.

Keywords : rnd-large, random-large & rand-large

ℹ️ New in Version 2.8

>>> tprint("test",f)
                                                                    
8888888 8888888888 8 8888888888      d888888o.   8888888 8888888888 
      8 8888       8 8888          .8888:&#39; 88.       8 8888       
      8 8888       8 8888          8.8888.   Y8       8 8888       
      8 8888       8 8888          8.8888.           8 8888       
      8 8888       8 888888888888   8.8888.          8 8888       
      8 8888       8 8888            8.8888.         8 8888       
      8 8888       8 8888             8.8888.        8 8888       
      8 8888       8 8888         8b   8.8888.       8 8888       
      8 8888       8 8888         8b.  ;8.8888       8 8888       
      8 8888       8 888888888888  Y8888P ,88P'       8 8888

6. Random xlarge

Randomly select from xlarge fonts.

Keywords : rnd-xlarge, random-xlarge & rand-xlarge

ℹ️ New in Version 2.8

>>> tprint("test","rnd-xlarge")
                                                                        
     /\    \                  /\    \                  /\    \              /\    \         
    /::\    \                /::\    \                /::\    \            /::\    \        
    \:::\    \              /::::\    \              /::::\    \           \:::\    \       
     \:::\    \            /::::::\    \            /::::::\    \           \:::\    \      
      \:::\    \          /:::/\:::\    \          /:::/\:::\    \           \:::\    \     
       \:::\    \        /:::/\:::\    \        /:::/\:::\    \           \:::\    \    
       /::::\    \      /::::\   \:::\    \       \:::\   \:::\    \          /::::\    \   
      /::::::\    \    /::::::\   \:::\    \    _\:::\   \:::\    \        /::::::\    \  
     /:::/\:::\    \  /:::/\:::\   \:::\    \  /\   \:::\   \:::\    \      /:::/\:::\    \ 
    /:::/  \:::\_\/:::/\:::\   \:::\\/::\   \:::\   \:::\\    /:::/  \:::\_\
   /:::/    \::/    /\:::\   \:::\   \::/    /\:::\   \:::\   \::/    /   /:::/    \::/    /
  /:::/    / \/_/  \:::\   \:::\   \//  \:::\   \:::\   \//   /:::/    / \/_/ 
 /:::/    /            \:::\   \:::\    \       \:::\   \:::\    \      /:::/    /          
/:::/    /              \:::\   \:::\_\       \:::\   \:::\_\    /:::/    /           
\::/    /                \:::\   \::/    /        \:::\  /:::/    /    \::/    /            
 \/_/                  \:::\   \//          \:::\/:::/    /      \/_/             
                           \:::\    \               \::::::/    /                           
                            \:::\__\               \::::/    /                            
                             \::/    /                \::/    /                             
                              \/_/                  \/_/

7. Wizard

This mode consider length of input text to select font

☑️ Support of 95 ASCII characters guaranteed

Keywords : wizard, wiz & magic

ℹ️ New in Version 2.9

>>> tprint("1","wizard")
    88 
  ,d88 
888888 
    88 
    88 
    88 
    88 
    88 
    88 
    88

>>> tprint("1"*5,"wizard") d88 d88 d88 d88 d88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 d88P d88P d88P d88P d88P

>>> tprint("1"*15,"wizard") # # # # # # # # # # # # # # #

## ## ## ## ## ## ## ## ## ## ## ## ## ##

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

## ## ## ## ## ## ## ## ## ## ## ## ## ##

8. Random Non-ASCII

Randomly select from Non-ASCII fonts.

Keywords : random-na, rand-na & rnd-na

ℹ️ New in Version 3.4

>>> tprint("test","random-na")
₮Ɇ₴₮
>>> tprint("test","random-na")
ʇsǝʇ

9. Mix Non-ASCII

Randomly mix Non-ASCII fonts.

Keywords : mix

ℹ️ New in Version 3.7

>>> tprint("test","mix")
†Ɛѕ†
>>> tprint("test","mix")
tᏋѕt
>>> tprint("test","mix")
꓄єร꓄

⚠️ Non-ASCII fonts are only available in Font name, Random Non-ASCII and Mix modes

Typo-tolerance

Levenshtein distance used in this project. (Version >0.9)
>>> aprint("happi")  # correct --> aprint("happy"), error < |artname|/2
 ۜ\(סּںסּَ )/ۜ 
&gt;&gt;&gt; Art=art(&quot;birds2222222&quot;,number=1) # correct --&gt; Art=art(&quot;birds&quot;,number=1), error &gt;= |artname|/2
Traceback (most recent call last):
	...
art.art.artError: Invalid art name.
&gt;&gt;&gt; aprint(&quot;happi231&quot;)  # correct --&gt; aprint(&quot;happy&quot;), error &lt; |artname|/2
⎦˚◡˚⎣ 
&gt;&gt;&gt; aprint(&quot;happi2312344&quot;) # correct --&gt; aprint(&quot;happy&quot;), error &gt;= |artname|/2
Traceback (most recent call last):
	...
art.art.artError: Invalid art name.
&gt;&gt;&gt; Art=text2art(&quot;test&quot;,f) # correct --&gt; Art=text2art(&quot;test&quot;,f)
&gt;&gt;&gt; print(Art)

.----------------. .----------------. .----------------. .----------------. | .--------------. || .--------------. || .--------------. || .--------------. | | | | || | | || | | || | __ | | | | | | | || | | | | || | / | | || | | _ | | | | | |/ | | \| | || | | | \| | || | | (_ \| | || | |/ | | \| | | | | | | | || | | | | || | &#39;._-. | || | | | | | | | | | | || | | |/ | | || | |\_) | | || | | |_ | | | | || | || | |_| | || | |.&#39; | || | |_| | | | | | || | | || | | || | | | | &#39;--------------&#39; || &#39;--------------&#39; || &#39;--------------&#39; || &#39;--------------&#39; | &#39;----------------&#39; &#39;----------------&#39; &#39;----------------&#39; &#39;----------------&#39;

&gt;&gt;&gt; tprint(&quot;test&quot;,f) # correct --&gt; tprint(&quot;test&quot;,f) | |_ [ | | | ] |</code></pre>

Set defaults

set_default function is added in Version 2.2 in order to change default values.

<pre><code class="lang-pycon">&gt;&gt;&gt; help(set_default) Help on function set_default in module art.art:

setdefault(f, chrignore=True, filename=&#39;art&#39;, print_status=True, overwrite=False, decoration=None, sep=&#39;\n&#39;) Change text2art, tprint and tsave default values. :param font: input font :type font:str :param chr_ignore: ignore not supported character :type chr_ignore:bool :param filename: output file name (only tsave) :type filename:str :param print_status : save message print flag (only tsave) :type print_status:bool :param overwrite : overwrite the saved file if true (only tsave) :type overwrite:bool :param decoration: input decoration :type decoration:str :param sep: line separator char :type sep: str :return: None

&gt;&gt;&gt; tprint(&quot;test&quot;) | | | | | | / \/ || _| | | | /\ \| | \| \||/ \|

&gt;&gt;&gt; set_default(f) &gt;&gt;&gt; tprint(&quot;test&quot;) / / / (- _) /</code></pre>

ℹ️ Functions error response updated in Version 0.8

<table> <tr> <td align="center">Function</td> <td align="center">Normal Output</td> <td align="center">Error</td> </tr> <tr> <td align="center">decor</td> <td align="center">str</td> <td align="center">raise artError</td> </tr> <tr> <td align="center">art</td> <td align="center">str</td> <td align="center">raise artError</td> </tr> <tr> <td align="center">aprint</td> <td align="center">None</td> <td align="center">raise artError</td> </tr> <tr> <td align="center">tprint</td> <td align="center">None</td> <td align="center">raise artError</td> </tr> <tr> <td align="center">tsave</td> <td align="center">{"Status":bool,"Message":str}</td> <td align="center">{"Status":bool,"Message":str}</td> </tr> <tr> <td align="center">text2art</td> <td align="center">str</td> <td align="center">raise artError</td> </tr> <tr> <td align="center">lprint</td> <td align="center">None</td> <td align="center">raise artError</td> </tr> <tr> <td align="center">line</td> <td align="center">str</td> <td align="center">raise artError</td> </tr> <tr> <td align="center">set_default</td> <td align="center">None</td> <td align="center">raise artError</td> </tr> </table>

Testing

  • Only ASCII fonts and arts :
<pre><code class="lang-">art test</code></pre>
  • All fonts, arts and decorations :
<pre><code class="lang-">art test2</code></pre>

CLI

⚠️ [Backward Compatibility] ART 5.9 is the last version to support this CLI structure officially

⚠️ You can use art or python -m art to run this mode

  • List of arts : art list or art arts
  • List of fonts : art fonts
  • Text : art text [yourtext] [fontname(optional)]
  • Art : art shape [artname] or art art [artname]
  • Save : art save [yourtext] [fontname(optional)]
  • All : art all [yourtext]

Telegram bot

Just send your text to one of these bots. 👇👇👇👇

<a href="https://t.me/artlibbot" target="_blank"><img src="https://img.shields.io/badge/Telegram-Bot1-red.svg"></a>

<a href="https://t.me/textartrobot" target="_blank"><img src="https://img.shields.io/badge/Telegram-Bot2-blue.svg"></a>

Try ART in your browser

  • ART can be used online in interactive Jupyter Notebooks via the Binder service! Try it out now! :
Binder
  • Open FontList.ipynb, ArtList.ipynb and DecorList.ipynb`
  • Edit and execute each part of the notes, step by step from the top panel by run button

Screen record

Screen Record

Issues & bug reports

  • Fill an issue and describe it. We'll check it ASAP!
- Please complete the issue template

References

Show your support

Star this repo

Give a ⭐️ if this project helped you!

Donate to our project

If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .

Art Donation

Become a sponsor to ART

  • Contact us at the email first

Corporate sponsor

  • $250 a month
  • Your company's logo can be featured on Readme
  • Intended for small companies

Mega corporate sponsor

  • $500 a month
  • Your company's logo can be featured on Readme and Website
  • Intended for medium-sized companies

Acknowledgments

Some parts of the infrastructure for this project are supported by:

DigitalOcean

Python Software Foundation (PSF) grants ART library from version 6.3 to 6.6. PSF is the organization behind Python. Their mission is to promote, protect, and advance the Python programming language and to support and facilitate the growth of a diverse and international community of Python programmers.

Python Software Foundation

© 2026 GitRepoTrend · sepandhaghighi/art · Updated daily from GitHub