- Overview
- Installation
- Usage
- Issues & Bug Reports
- Dependencies
- Contribution
- Reference
- Authors
- License
- Donate
- Changelog
- Code of Conduct
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 | 540 |
1-Line-Art Counter | 516 |
Branch | master | dev |
Travis | ||
AppVeyor |
Code Quality |
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_3=art("love_you",number=1,text="test") # 2-part art
>>> print(art_3)
»-(¯`·.·´¯)->test<-(¯`·.·´¯)-«
>>> art("random") # random 1-line art mode
'(っ◕‿◕)っ '
>>> art("rand") # random 1-line art mode
't(-_-t) '
>>> art(22,number=1,text="") # raise artError
Traceback (most recent call last):
...
art.art.artError: artname shoud have str type
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("love_you",number=1,text="test") # 2-part art
»-(¯`·.·´¯)->test<-(¯`·.·´¯)-«
>>> aprint("random") # random 1-line art mode
'(っ◕‿◕)っ '
>>> aprint("rand") # random 1-line art mode
't(-_-t) '
>>> aprint("woman",number="22",text="") # raise artError
Traceback (most recent call last):
...
art.art.artError: number should have int type
randart
function is added in Version 2.2
as art("random")
shortcut.
>>> randart()
'ዞᏜ℘℘Ꮍ ℬℹℛʈዞᗬᏜᎽ '
>>> randart()
'✌(◕‿-)✌ '
- Note : Use
ART_NAMES
to access all arts name list (new inVersion 4.2
)
Version 3.3
Non-ASCII fonts added (These fonts are not compatible with some environments)
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('''Lorem
ipsum
dolor''', font="small")) # Multi-line print
_
| | ___ _ _ ___ _ __
| |__ / _ \| '_|/ -_)| ' \
|____|\___/|_| \___||_|_|_|
_
(_) _ __ ___ _ _ _ __
| || '_ \(_-<| || || ' \
|_|| .__//__/ \_,_||_|_|_|
|_|
_ _
__| | ___ | | ___ _ _
/ _` |/ _ \| |/ _ \| '_|
\__,_|\___/|_|\___/|_|
>>> print(text2art("test","white_bubble")) # Non-ASCII font example
ⓣⓔⓢⓣ
>>> text2art("seسسس",font=DEFAULT_FONT,chr_ignore=False) # raise artError in exception
Traceback (most recent call last):
...
art.art.artError: س is invalid
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") # random font mode
___ ____ ____ ___
| |___ [__ |
| |___ ___] |
>>> tprint('testسس',chr_ignore=False) # raise artError in exception
Traceback (most recent call last):
...
art.art.artError: س is invalid
>>> tprint('''Lorem
ipsum
dolor''', font="cybermedium") # Multi-line print
_ ____ ____ ____ _ _
| | | |__/ |___ |\/|
|___ |__| | \ |___ | |
_ ___ ____ _ _ _ _
| |__] [__ | | |\/|
| | ___] |__| | |
___ ____ _ ____ ____
| \ | | | | | |__/
|__/ |__| |___ |__| | \
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",print_status=False) # save ASCII text in test.txt file without save message (print_status==False)
>>> Response["Message"]
'OK'
>>> Response["Status"]
True
>>> tsave(22,font=DEFAULT_FONT,filename="art",chr_ignore=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
- Note1 : Use
FONT_NAMES
to access all fonts name list (new inVersion 4.2
) - Note2 : Use
NON_ASCII_FONTS
to access all Non-ASCII fonts name list (new inVersion 4.4
)
These modes are available for text2art
, tprint
& tsave
.
>>> tprint("art",font="block",chr_ignore=True)
.----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. |
| | __ | || | _______ | || | _________ | |
| | / \ | || | |_ __ \ | || | | _ _ | | |
| | / /\ \ | || | | |__) | | || | |_/ | | \_| | |
| | / ____ \ | || | | __ / | || | | | | |
| | _/ / \ \_ | || | _| | \ \_ | || | _| |_ | |
| ||____| |____|| || | |____| |___| | || | |_____| | |
| | | || | | || | | |
| '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------'
>>> tprint("art","white_bubble")
ⓐⓡⓣ
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
- Note : New in
Version 2.8
>>> tprint("test",font="rnd-small")
_/ _ _ _/
/ (- _) /
Randomly select from medium fonts.
Keywords : rnd-medium
, random-medium
& rand-medium
- Note : New in
Version 2.8
>>> tprint("test",font="rnd-medium")
, ,
|| ||
=||= _-_ _-_, =||=
|| || \\ ||_. ||
|| ||/ ~ || ||
\\, \\,/ ,-_- \\,
Randomly select from large fonts.
Keywords : rnd-large
, random-large
& rand-large
- Note : New in
Version 2.8
>>> tprint("test",font="rnd-large")
8888888 8888888888 8 8888888888 d888888o. 8888888 8888888888
8 8888 8 8888 .`8888:' `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
Randomly select from xlarge fonts.
Keywords : rnd-xlarge
, random-xlarge
& rand-xlarge
- Note : New in
Version 2.8
>>> tprint("test","rnd-xlarge")
_____ _____ _____ _____
/\ \ /\ \ /\ \ /\ \
/::\ \ /::\ \ /::\ \ /::\ \
\:::\ \ /::::\ \ /::::\ \ \:::\ \
\:::\ \ /::::::\ \ /::::::\ \ \:::\ \
\:::\ \ /:::/\:::\ \ /:::/\:::\ \ \:::\ \
\:::\ \ /:::/__\:::\ \ /:::/__\:::\ \ \:::\ \
/::::\ \ /::::\ \:::\ \ \:::\ \:::\ \ /::::\ \
/::::::\ \ /::::::\ \:::\ \ ___\:::\ \:::\ \ /::::::\ \
/:::/\:::\ \ /:::/\:::\ \:::\ \ /\ \:::\ \:::\ \ /:::/\:::\ \
/:::/ \:::\____\/:::/__\:::\ \:::\____\/::\ \:::\ \:::\____\ /:::/ \:::\____\
/:::/ \::/ /\:::\ \:::\ \::/ /\:::\ \:::\ \::/ / /:::/ \::/ /
/:::/ / \/____/ \:::\ \:::\ \/____/ \:::\ \:::\ \/____/ /:::/ / \/____/
/:::/ / \:::\ \:::\ \ \:::\ \:::\ \ /:::/ /
/:::/ / \:::\ \:::\____\ \:::\ \:::\____\ /:::/ /
\::/ / \:::\ \::/ / \:::\ /:::/ / \::/ /
\/____/ \:::\ \/____/ \:::\/:::/ / \/____/
\:::\ \ \::::::/ /
\:::\____\ \::::/ /
\::/ / \::/ /
\/____/ \/____/
This mode consider length of input text to select font
☑️ Support of 95 ASCII characters guaranteed
Keywords : wizard
, wiz
& magic
- Note : 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")
# # # # # # # # # # # # # # #
## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # #
## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
Randomly select from Non-ASCII fonts.
Keywords : random-na
, rand-na
& rnd-na
- Note : New in
Version 3.4
>>> tprint("test","random-na")
₮Ɇ₴₮
>>> tprint("test","random-na")
ʇsǝʇ
Randomly mix Non-ASCII fonts.
Keywords : mix
- Note : New in
Version 3.7
>>> tprint("test","mix")
†Ɛѕ†
>>> tprint("test","mix")
tᏋѕt
>>> tprint("test","mix")
꓄єร꓄
Font name
, Random Non-ASCII
and Mix
modes
Levenshtein distance used in this project. (Version
>0.9)
>>> Art=art("loveyou",number=1,text="test") # correct --> art("love_you",number=1,text="test"), error < |artname|/2
>>> print(Art)
»-(¯`·.·´¯)->test<-(¯`·.·´¯)-«
>>> aprint("happi") # correct --> aprint("happy"), error < |artname|/2
ۜ\(סּںסּَ` )/ۜ
>>> Art=art("birds2222222",number=1) # correct --> Art=art("birds",number=1), error >= |artname|/2
Traceback (most recent call last):
...
art.art.artError: Invalid art name
>>> aprint("happi231") # correct --> aprint("happy"), error < |artname|/2
⎦˚◡˚⎣
>>> aprint("happi2312344") # correct --> aprint("happy"), error >= |artname|/2
Traceback (most recent call last):
...
art.art.artError: Invalid art name
>>> Art=text2art("test",font="black") # correct --> Art=text2art("test",font="block")
>>> print(Art)
.----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| | _________ | || | _________ | || | _______ | || | _________ | |
| | | _ _ | | || | |_ ___ | | || | / ___ | | || | | _ _ | | |
| | |_/ | | \_| | || | | |_ \_| | || | | (__ \_| | || | |_/ | | \_| | |
| | | | | || | | _| _ | || | '.___`-. | || | | | | |
| | _| |_ | || | _| |___/ | | || | |`\____) | | || | _| |_ | |
| | |_____| | || | |_________| | || | |_______.' | || | |_____| | |
| | | || | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------' '----------------'
>>> tprint("test",font="cybermedum") # correct --> tprint("test",font="cybermedium")
___ ____ ____ ___
| |___ [__ |
| |___ ___] |
set_default
function is added in Version 2.2
in order to change default values.
>>> help(set_default)
Help on function set_default in module art.art:
set_default(font='standard', chr_ignore=True, filename='art', print_status=True, overwrite=False)
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
:return: None
>>> tprint("test")
_ _
| |_ ___ ___ | |_
| __| / _ \/ __|| __|
| |_ | __/\__ \| |_
\__| \___||___/ \__|
>>> set_default(font="italic")
>>> tprint("test")
_/ _ _ _/
/ (- _) /
-
Note : Functions error response updated in
Version 0.8
Function Normal Output Error 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 set_default None raise artError
- Only ASCII fonts and arts :
python -m art test
- All fonts and arts :
python -m art test2
- List of arts :
python -m art list
orpython -m art arts
- List of fonts :
python -m art fonts
- Text :
python -m art text yourtext fontname(optional)
- Art :
python -m art shape art_name
orpython -m art art art_name
- Save :
python -m art save yourtext fontname(optional)
- All :
python -m art all yourtext
Just send your text to one of these bots. 👇👇👇👇
ART can be used online in interactive Jupyter Notebooks via the Binder service! Try it out now! :
- Open
FontList.ipynb
andArtList.ipynb
- Edit and execute each part of the notes, step by step from the top panel by run button
Just fill an issue and describe it. I'll check it ASAP! or send an email to info@4r7.ir.
- Please complete the issue template
master | dev |
- FIGlet
- 1 Line Art
- Text To ASCII
- ASCII Generator
- Asky
- Flipyourtext
- YayText
- Coolletters
- Instagram Fonts
- Cool Symbol
- ASCII Moji
- SMILEY COOL
- SPREZZ
- Textart4u
- Chat4o
- Findwebapp
- Hubpages
- ASCII-ART
- Messletters
12Xm1qL4MXYWiY9sRMoa3VpfTfw6su3vNq