ASCII Art Library For Python
Project description
Table of contents
- Overview
- Installation
- Usage
- Issues & Bug Reports
- Contribution
- Reference
- Authors
- License
- Donate
- Changelog
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 | |
Github Stars | |
Font Counter | 270 |
1-Line-Art Counter | 250 |
Branch | master | dev |
Travis | ||
AppVeyor |
Usage
1-Line Art
- 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_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
- 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("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
randart
function is added in Version 2.2
as art("random")
shortcut
>>> randart()
'ዞᏜ℘℘Ꮍ ℬℹℛʈዞᗬᏜᎽ '
>>> randart()
'✌(◕‿-)✌ '
ASCII Text
- 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)
___ ____ ____ ___
| |___ [__ |
| |___ ___] |
>>> text2art("seسسس",font=DEFAULT_FONT,chr_ignore=False) # raise artError in exception
Traceback (most recent call last):
...
art.art.artError: س is invalid
- 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") # random font mode
___ ____ ____ ___
| |___ [__ |
| |___ ___] |
>>> tprint('testسس',chr_ignore=False) # raise artError in exception
Traceback (most recent call last):
...
art.art.artError: س is invalid
>>> tprint('''Lorem # Multi-line print
ipsum
dolor''', font="cybermedium")
_ ____ ____ ____ _ _
| | | |__/ |___ |\/|
|___ |__| | \ |___ | |
_ ___ ____ _ _ _ _
| |__] [__ | | |\/|
| | ___] |__| | |
___ ____ _ ____ ____
| \ | | | | | |__/
|__/ |__| |___ |__| | \
- 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",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'"}
Typo-Tolerance
Levenshtein distance used in this project. (Version
>0.9)
>>> Art=art("loveyou",number=1,text="test") # correct --> art("love_you",number=1,text="test") (distance < 3)
>>> print(Art)
»-(¯`·.·´¯)->test<-(¯`·.·´¯)-«
>>> aprint("happi") # correct --> aprint("happy") (distance < 3)
ۜ\(סּںסּَ` )/ۜ
>>> Art=art("birds2222",number=1) # correct --> Art=art("birds",number=1) (distance > 3)
>>> print(Art)
Traceback (most recent call last):
...
art.art.artError: Invalid art name
>>> aprint("happi231") # correct --> aprint("happy") (distance > 3)
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 Defaults
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)
This fuction 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
: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
CLI
- List of arts :
python -m art list
orpython -m art arts
- List of fonts :
python -m art fonts
- Test :
python -m art test
- 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
Telegram Bot
Just send your text to one of these bots. 👇👇👇👇
Screen Record
Issues & Bug Reports
Just fill an issue and describe it. I'll check it ASAP! or send an email to sepand@qpage.ir.
License
Reference
Donate to our project
Bitcoin :
12Xm1qL4MXYWiY9sRMoa3VpfTfw6su3vNq
Payping (For Iranian citizens)
Say Thanks!
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
2.6 - 2018-12-05
Added
- 20 new fonts
- xbrite
- xbriteb
- xbritei
- xbritebi
- xchartr
- xchartri
- xcour
- xcourb
- xcourbi
- xcouri
- xhelv
- xhelvb
- xhelvbi
- xhelvi
- xsans
- xsansb
- xsansbi
- xsansi
- xtimes
- xttyb
- CLI
testcov
flag
Changed
requirements.txt
modifiedINSTALL.md
modified- CLI
test
flag modified
2.5 - 2018-12-02
Added
- 15 new fonts
- char1
- char2
- char3
- char4
- charact1
- charact2
- charact3
- charact4
- charact5
- charact6
- characte
- chartr
- chartri
- 1943
- advenger
dev-requirements.txt
Changed
Python 3.7
added to.travis.yml
&appveyor.yml
font_list
modifiedREADME.md
modifiedINSTALL.md
modified
2.4 - 2018-10-30
Added
- 10 new fonts
- alpha
- alligator3
- amc3liv1
- ascii_new_roman
- B1FF
- dwhistled
- eftiwall
- fire_font-k
- fire_font-s
- gradient
Changed
requirements.txt
modified
2.3 - 2018-09-30
Added
- 35 new fonts
- nancyj-improved
- nscript
- ntgreek
- nvscript
- octal
- oldbanner
- os2
- peaksslant
- puzzle
- rammstein
- red_phoenix
- runyc
- santaclara
- shimrod
- smallcaps
- smpoison
- soft
- spliff
- stacey
- stampate
- stforek
- sub-zero
- swampland
- sweet
- ticks
- ticksslant
- tiles
- tsalagi
- tubular
- twisted
- varsity
- wavy
- wetletter
- whimsy
- wow
2.2 - 2018-09-24
Added
- 15 new fonts
- ICL-1900
- impossible
- jacky
- katakana
- keyboard
- knob
- lildevil
- lineblocks
- merlin1
- merlin2
- modular
- morse
- morse2
- moscow
- muzzle
set_default
functionrandart
function
2.1 - 2018-09-18
Added
- 15 new fonts
- fraktur
- funface
- funfaces
- georgi16
- georgia11
- ghost
- ghoulish
- glenyn
- graceful
- greek
- heartleft
- heartright
- henry3d
- horizontalleft
- horizontalright
Changed
setuptools
removed fromrequirements.txt
OSX
env added to.travis.yml
- Test cases modified
text2art
bug in OSX fixed
2.0 - 2018-08-30
Added
- 20 new fonts
- bigfig
- bolger
- braced
- bright
- broadway
- cards
- chiseled
- cola
- crawford
- cricket
- DANC4
- dancingfont
- decimal
- defleppard
- dietcola
- flipped
- double
- doubleshorts
- eftipiti
- filter
- Font list HTML page
- Art list HTML page
1.9 - 2018-08-23
Added
- 20 new fonts
- cybersmall
- gothic
- rev
- smtengwar
- term
- 1row
- 3d_diagonal
- 4max
- amc3line
- amcrazor
- amcaaa01
- amcneko
- amcrrazo2
- amcslash
- amcthin
- amctubes
- amcun1
- arrows
- bear
- benjamin
1.8 - 2018-08-06
Added
- 30 new 1-line art
- westbound fish
- telephone
- 9/11 truth
- spear
- srs face
- this is areku
- robot boy
- med man
- angry
- badass
- zoidberg
- eastbound fish
- kilroy was here
- gtalk fit
- thanks
- dalek
- sean the sheep
- kablewee
- i dont care
- slenderman
- john lennon
- peace yo
- punch
- russian boobs
- fuck off
- man tears
- robber
- facepalm
- yo
- party time
1.7 - 2018-08-01
Added
- 30 new 1-line art
- crayons
- stars in my eyes
- fish invasion
- bender
- musical
- sunny day
- happy birthday 1
- line brack
- med
- melp1
- happy3
- happy square
- snowman
- melp2
- i kill you
- jaymz
- text decoration
- long rose
- kirbay dance
- death star defense team
- chainsword
- boobies
- dancing people
- dance
- pictou
- polar bear
- go away bear
- charly
- train
- spot
Changed
- car race 1-line art fixed
1.6 - 2018-07-10
Added
- 30 new 1-line art
- sexy symbol
- barbell
- sniper rifle
- being draged
- possessed
- jokeranonimous
- epic gun
- love
- love2
- eric
- puls
- sky free
- smug bastard
- tie-fighter
- kyubey
- dancee
- mtmtika
- ak-47
- eaten apple
- huhu
- faydre
- domino
- honeycute
- superman
- worm2
- jokeranonimous2
- kyubey2
- nose2
- hell yeah
- roke
1.5 - 2018-06-18
Added
- 30 new 1-line art
- sorreh bro
- yolo
- formula 1 car
- dummy
- rope
- rare
- chess pieces
- sparkling heart
- weather
- stars2
- upsidedown
- nathan
- cat smile
- old lady boobs
- glasses2
- religious
- sniperstars
- kokain
- bagel
- crying
- angry2
- 3
- 5
- fuck you
- head shot
- metal
- killer
- fu
- ankush
- owlkin
Changed
- CLI
art
flag - CLI
list
flag
1.4 - 2018-06-14
Added
- 15 new fonts
- letters
- lockergnome
- madrid
- marquee
- mike
- mini
- nancyj-fancy
- nancyj-underlined
- pepper
- poison
- rot13
- short
- small
- tengwar
- big
- 11 new 1-line art
- teddy
- dice
- bee
- ukulele
- perky
- snail
- decorate
- kirby
- mango
- bunny
- kiss
- random 1-line art mode
Changed
- Minor bug in
text2art
random range fixed README.md
modifiedaprint_test
function renamed toart_list
setup.py
modified
1.3 - 2018-06-08
Added
- 10 new fonts
- eftitalic
- eftiwater
- fourtops
- goofy
- hollywood
- invita
- italic
- jazmine
- lcd
- lean
- random font mode
1.2 - 2018-06-04
Added
- 8 new fonts
- barbwire
- bigchief
- binary
- bubble
- calgphy2
- cygnet
- diamond
- eftifont
Changed
- Test cases modified
1.1 - 2018-05-25
Added
- 5 new fonts
- peaks
- pawp
- o8
- nipples
- maxfour
- 15 new 1-line art
- guitar
- rocket
- ghost
- hal
- cthulhu
- sat
- what
- king
- tron
- homer
- fox
- singing
- atish
- zable
- trumpet
- CLI description
Changed
README.md
modified- Test cases modified
- File name bug in UNIX fixed
CHANGELOG.md
modified
1.0 - 2018-05-20
Added
- 15 new fonts
- tinker-toy
- straight
- stampatello
- smslant
- smshadow
- smscript
- smkeyboard
- smisome1
- slscript
- slide
- sblood
- rozzo
- pyramid
- puffy
- pebbles
- Typo-Tolerance system
Changed
README.md
modified- Test cases modified
0.9 - 2018-05-08
Added
- 10 new fonts
- weird
- univers
- twopoint
- trek
- tombstone
- threepoint
- thick
- tanja
- swan
- stellar
Changed
MANIFEST.in
modifiedINSTALL.md
modified
0.8 - 2018-03-13
Added
CHANGELOG.md
Changed
- Functions error response
README.md
modifiedtsave
function extension bug fixedtext2art
response bug fixed ("\r\n")setup.py
modified
0.7 - 2018-01-20
Added
- 10 new fonts
- acrobatic
- alligator
- alligator2
- block2
- caligraphy
- computer
- digital
- doh
- eftirobot
- graffiti
0.6 - 2018-01-09
Added
- all flag
0.5 - 2017-12-05
Added
- 10 new fonts
- 3-d
- 3x5
- 5lineoblique
- alphabet
- banner3-D
- banner3
- banner4
- bell
- catwalk
- colossal
0.4 - 2017-11-11
Added
- Telegram bot
Changed
- Universal Text Format Added For Unix & Windows
0.3 - 2017-10-28
Added
- Save function (tsave)
- chr_ignore flag
- 10 new fonts
- banner
- avatar
- basic
- bulbhead
- chunky
- coinstak
- contessa
- contrast
- cyberlarge
- cybermedium
- doom
- dotmatrix
- drpepper
- epic
- fuzzy
- isometric1
- isometric2
- isometric3
- isometric4
- larry3d
- nancyj
- ogre
- rectangles
- roman
- rounded
- rowancap
- script
- serifcap
- shadow
- slant
- speed
- starwars
- stop
- thin
- usaflag
- overall_stat
Changed
- Space bug fixed
0.2 - 2017-10-10
Added
- Standard font
Changed
- Minor bugs fixed
Changed
- statistic_result to class_stat
- params() to stat()
0.1 - 2017-10-04
Added
- Block font
- 1-Line art
- CLI commands
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file art-2.6.tar.gz
.
File metadata
- Download URL: art-2.6.tar.gz
- Upload date:
- Size: 393.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/3.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.4.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad694b7b13064084e9253c5305f248b6e3a8b75b86deccbabe5cf2113e829fab |
|
MD5 | f3352f15cc2a7d67de4b869904d38086 |
|
BLAKE2b-256 | c1b8141d53560daf100c18b3851b504fbfe2e9b42332ba33bac45c63dd8bd7b8 |
File details
Details for the file art-2.6-py2.py3-none-any.whl
.
File metadata
- Download URL: art-2.6-py2.py3-none-any.whl
- Upload date:
- Size: 363.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/3.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.4.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2686eb314beeece5192b4b6840bbc5be332bbef4c8b8028c2f20c76a47a671a |
|
MD5 | 624ff23f96658ea26cbd1bb4c495b30b |
|
BLAKE2b-256 | 841d6519b29ae68f5e9c25432228ad612e7327f52a3160608273fbc7e029d35f |