ASCII art library for Python
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 | |
| Github Stars | |
| Font Counter | 677 |
| 1-Line-Art Counter | 711 |
| Decor Counter | 218 |
| Branch | master | dev |
| CI |
| Code Quality |
⚠️ Some environments don't support all 1-Line arts
⚠️ ART 4.6 is the last version to support Bipartite 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.
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.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.
…
#### 2. tprint
This function print ASCII text in normal mode (return None) and raise `artError` in exception.
…
#### 3. tsave
This function return `dict` in normal and exception mode.
…
ℹ️ Use `FONT_NAMES` to access all fonts name list (new in `Version 4.2`)
ℹ️ Use `NON_ASCII_FONTS` 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.
```pycon
>>> lprint(length=15, height=2, char="*")
***************
***************ℹ️ New in Version 6.4
ℹ️ The default values are length=15, height=1, char='#'
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='#'
⚠️ Some environments don't support all decorations
This function return decoration as str in normal mode and raise artError in exception.
…ℹ️ Use DECORATION_NAMES to access all decorations name list (new in Version 4.6)
These modes are available for text2art, tprint & tsave.
⚠️ Some fonts don't support all characters
…Randomly select from all fonts.
Keywords : random, rand & rnd
>>> tprint("test",font="random")
| |
~|~/~/(~~|~
| \/__) |
Randomly select from small fonts.
Keywords : rnd-small, random-small & rand-small
ℹ️ New in Version 2.8
>>> tprint("test",font="rnd-small")
_/ _ _ _/
/ (- _) /
Randomly select from medium fonts.
Keywords : rnd-medium, random-medium & rand-medium
ℹ️ New in Version 2.8
>>> tprint("test",font="rnd-medium")
, ,
|| ||
=||= _-_ _-_, =||=
|| || \\ ||_. ||
|| ||/ ~ || ||
\\, \\,/ ,-_- \\,
Randomly select from large fonts.
Keywords : rnd-large, random-large & rand-large
ℹ️ New in Version 2.8
…Randomly select from xlarge fonts.
Keywords : rnd-xlarge, random-xlarge & rand-xlarge
ℹ️ New in Version 2.8
…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
…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ǝʇ
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
Levenshtein distance used in this project. (Version >0.9)
…set_default function is added in Version 2.2 in order to change default values.
…ℹ️ Functions error response updated in Version 0.8
| Function | Normal Output | Error |
| decor | str | raise artError |
| art | str | raise artError |
| aprint | None | raise artError |
| tprint | None | raise artError |
| tsave | {"Status":bool,"Message":str} | {"Status":bool,"Message":str} |
| text2art | str | raise artError |
| lprint | None | raise artError |
| line | str | raise artError |
| set_default | None | raise artError |
art testart test2⚠️ [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
art list or art artsart fontsart text [yourtext] [fontname(optional)]art shape [artname] or art art [artname]art save [yourtext] [fontname(optional)]art all [yourtext]Just send your text to one of these bots.
FontList.ipynb, ArtList.ipynb and DecorList.ipynbNo open issues yet, or sync has not completed.