Coder Social home page Coder Social logo

sepandhaghighi / art Goto Github PK

View Code? Open in Web Editor NEW
2.0K 22.0 118.0 7.76 MB

🎨 ASCII art library for Python

Home Page: https://www.ascii-art.site

License: MIT License

Python 91.58% Jupyter Notebook 8.28% Batchfile 0.03% Shell 0.01% MATLAB 0.10%
ascii ascii-art ascii-text text art python3 python python-library python-lib fun

art's Introduction


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 657
1-Line-Art Counter 710
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
 ۜ\(סּںסּَ` )/ۜ
>>> 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()
'✌(◕‿-)✌ '
  • Note1 : Use ART_NAMES to access all arts name list (new in Version 4.2)
  • Note2 : Use NON_ASCII_ARTS to access all Non-ASCII arts name list (new in Version 4.6)
  • Note3 : 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") # 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''', font="cybermedium") # Multi-line print
_    ____ ____ ____ _  _    
|    |  | |__/ |___ |\/|    
|___ |__| |  \ |___ |  |    
                            
_ ___  ____ _  _ _  _    
| |__] [__  |  | |\/|    
| |    ___] |__| |  |    
                         
___  ____ _    ____ ____ 
|  \ |  | |    |  | |__/ 
|__/ |__| |___ |__| |  \ 

>>> tprint("art",font="fancy5",decoration="barcode1") # decoration parameter is added in Version 4.6
▌│█║▌║▌║ ᏗᏒᏖ ║▌║▌║█│▌
>>> tprint("art",font="fancy5",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",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
>>> 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                        
  • Note1 : Use FONT_NAMES to access all fonts name list (new in Version 4.2)
  • Note2 : Use NON_ASCII_FONTS to access all Non-ASCII fonts name list (new in Version 4.4)
  • Note3 : Use ASCII_FONTS to access all ASCII fonts name list (new in Version 5.7)

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   ",font="fancy42") + 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
['‹–…·´`·…–›', '‹–…·´`·…–›']
>>> decor(None)
Traceback (most recent call last):
	...
art.art.artError: The 'decoration' type must be str.
  • Note : 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",font="block",chr_ignore=True)

 .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. |
| |      __      | || |  _______     | || |  _________   | |
| |     /  \     | || | |_   __ \    | || | |  _   _  |  | |
| |    / /\ \    | || |   | |__) |   | || | |_/ | | \_|  | |
| |   / ____ \   | || |   |  __ /    | || |     | |      | |
| | _/ /    \ \_ | || |  _| |  \ \_  | || |    _| |_     | |
| ||____|  |____|| || | |____| |___| | || |   |_____|    | |
| |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'

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

2. Random

Randomly select from all fonts.

Keywords : random, rand & rnd

>>> tprint("test",font="random")
 |       | 
~|~/~/(~~|~
 | \/__) | 
  

3. Random small

Randomly select from small fonts.

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

  • Note : New in Version 2.8
>>> tprint("test",font="rnd-small")
             
_/  _   _ _/ 
/  (- _)  /  
             

4. Random medium

Randomly select from medium fonts.

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

  • Note : New in Version 2.8
>>> tprint("test",font="rnd-medium")
                      
  ,                ,  
 ||               ||  
=||=  _-_   _-_, =||= 
 ||  || \\ ||_.   ||  
 ||  ||/    ~ ||  ||  
 \\, \\,/  ,-_-   \\, 
                      
                      

5. Random large

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       

6. Random xlarge

Randomly select from xlarge fonts.

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

  • Note : 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

  • 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")
                                             
                                             
 #  #  #  #  #  #  #  #  #  #  #  #  #  #  # 
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## 
 #  #  #  #  #  #  #  #  #  #  #  #  #  #  # 
 #  #  #  #  #  #  #  #  #  #  #  #  #  #  # 
 #  #  #  #  #  #  #  #  #  #  #  #  #  #  # 
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## 
                                             
                                             

8. Random Non-ASCII

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ǝʇ

9. Mix Non-ASCII

Randomly mix Non-ASCII fonts.

Keywords : mix

  • Note : 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
 ۜ\(סּںסּَ` )/ۜ 
>>> 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 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, overwrite=False, decoration=None, sep='\n')
    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

>>> tprint("test")
 _               _   
| |_   ___  ___ | |_ 
| __| / _ \/ __|| __|
| |_ |  __/\__ \| |_ 
 \__| \___||___/ \__|
                     

>>> set_default(font="italic")
>>> tprint("test")
             
_/  _   _ _/ 
/  (- _)  /  
             
  • Note : 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
    set_default None raise artError

Testing

  • Only ASCII fonts and arts :
art test
  • All fonts, arts and decorations :
art test2

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. 👇👇👇👇

Try ART in your browser

  1. 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
  1. ART also can be used online in ascii-generator.site, a Django website by hermanTenuki

Screen record

Screen Record

Issues & bug reports

  1. Fill an issue and describe it. We'll check it ASAP!
    • Please complete the issue template
  2. Discord : https://discord.com/invite/FAAyq3QJqP
  3. Website : https://www.ascii-art.site
  4. Email : [email protected]

Reference

  1. FIGlet
  2. 1 Line Art
  3. Text to ASCII
  4. ASCII Generator
  5. Asky
  6. Flipyourtext
  7. YayText
  8. Coolletters
  9. Instagram Fonts
  10. Cool Symbol
  11. ASCII Moji
  12. SMILEY COOL
  13. SPREZZ
  14. Textart4u
  15. Chat4o
  16. Findwebapp
  17. Hubpages
  18. ASCII-ART
  19. Messletters
  20. Webestools
  21. ASCII-emoji
  22. Instagram Fonts2
  23. Emotiworld
  24. Fancy Text Pro
  25. Playing Cards in Unicode
  26. Text Generator
  27. GOGOTEXT
  28. Fsymbols
  29. Font Copy and Paste
  30. Mega Cool Text
  31. ToolCalculator
  32. Copy Paste Fonts

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

art's People

Contributors

codewithnick avatar datinkerer avatar dependabot-preview[bot] avatar eumiro avatar pyup-bot avatar sadrasabouri avatar sepandhaghighi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

art's Issues

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Use lower version of setuptools to enable usage of pex

I don't evidently see the reason why the package would need a higher version of setuptools (>=39.2.0). This prevents the usage of pex, which has a requirement of setuptools>=20.3,<34.0.
As pex is widely used, it would perhaps be feasible to disable the constraint of enforcing a higher version of setuptools.

Add text-decoration

Description

Add decoration parameter to text2art, tsave and tprint functions

Expected Behavior

>>> from art import *
>>> tprint("test",font="fancy6",decoration="1")
▁ ▂ ▄ ▅ ▆ ▇ █ᏖᏋᏕᏖ█ ▇ ▆ ▅ ▄ ▂ ▁

Tried `aprint("rand")` from docs and got warning "[Warning] 'rand' is not printable in this environment."

Description

Tried aprint("rand") from docs README.md and got warning [Warning] 'rand' is not printable in this environment. seems more like an error cos I don't get any output other than the warning.

Steps/Code to Reproduce

from art import  *
aprint("rand")

Expected Behavior

one of the following at least

>>> 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) '

Actual Behavior

[Warning] 'rand' is not printable in this environment.

Operating System

Windows 10 Pro

Python Version

3.8.1

ART Version (Use : art.__version__)

4.4

tsave bug in windows

Description

It seems tsave function has some problems in Windows

Steps/Code to Reproduce

>>> from art import *
>>> tsave("test","block",filename="test.txt")
Saved!
Filename: test2.txt
{'Message': 'OK', 'Status': True}

Expected Behavior

expected

Actual Behavior

actual

Operating System

Windows 10

Python Version

Python 3.6

ART Version (Use : art.__version__)

ART 4.5

art not printing ASCII text when compiled using pyinstaller

Description

When Python Code converted into Binary using Pyinstaller, It doesn't print ASCII text into Console anymore.

Steps/Code to Reproduce

  1. Install art and pyisntaller using pip
  2. create a simple Program such as
from art import *
tprint("Test",font="univers")
  1. compile it using pyinstaller. pyinstaller --onefile test.py
  2. open it.

Expected Behavior

Should print ASCII text into Console

Actual Behavior

Not Printing Any text into Console

Operating System

Windows 10

Python Version

3.7.4

ART Version

4.5

tsave error for some fonts

Description

tsave function error for some fonts

Steps/Code to Reproduce

>>> from art import *
>>> Data = tsave("test@34",font="antrophobia",filename="antrophobia.txt",print_status=False)
>>> Data["Message"]

Expected Behavior

OK

Actual Behavior

'ascii' codec can't decode byte 0xd1 in position 0: ordinal not in range(128)

Operating System

Ubuntu 14.04

Python Version

Python 2.7.6

ART Version (Use : art.__version__)

3.9

output to file

salaam

Please add some option to print created art work to a text or jpg file.

regards.

tprint and aprint error in some enviroments

Description

tprint and aprint error in some enviroments

Steps/Code to Reproduce

>>> tprint("test","fancy45")

Expected Behavior

тešт

Actual Behavior

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Sepkjaer\AppData\Local\Programs\Python\Python35-32\lib\site-packages\art-3.9-py3.5.egg\art\art.py", line 194, in tprint
  File "C:\Users\Sepkjaer\AppData\Local\Programs\Python\Python35-32\lib\encodings\cp720.py", line 21, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-4: character maps to <undefined>

Operating System

Windows 10

Python Version

Python 3.5

ART Version (Use : art.__version__)

3.9

Wizard mode enhancement

Description

  • wizard mode should guarantee support of all 95 printable ASCII characters
  • Add more fonts

art in MATLAB

Description

Add an example to show : how to use art in MATLAB

font_wizard enhancement

Description

Adding fonts to art could be boring with some repeated steps that should be considered for each font.
font_wizard.py has been developed by @sepandhaghighi as a solution to this problem but it can be more helpful.

New features for font_wizard

  1. It can asks for font's name first and it's optional extra questions (for example "Is it ASCII or not?")
  2. Run FontList.ipynb and autopep8
  3. update font index in README.md
  4. add a test case for new added font

Complete contribution guideline for adding a font can be found here.

utf-8 characters like Chinese cannot show.

Description

I want to show some Chinese in ascii art,but it didn't work.Is there a way to support that?Thanks!

from art import *
art_1=art("你好hello") # return art as str in normal mode
print(art_1)

It cannot be show ascii draw correctly.

Add overwrite option to tsave function

Description

Adding overwrite flag to tsave function

Steps/Code to Reproduce

>>> tsave("test","standard",filename="test1.txt")
Saved! 
Filename: test1.txt
{'Message': 'OK', 'Status': True}
>>> tsave("test","standard",filename="test1.txt",overwrite=True)

Expected Behavior

Saved! 
Filename: test1.txt
{'Message': 'OK', 'Status': True}

Saving problem for more than one dot(.) filenames

Description

When using tsave function to save files with more than one dot, it produce some issues.

Steps/Code to Reproduce

>>> tsave("test","standard",filename="test1.2.txt")

Expected Behavior

Saved! 
Filename: test1.2.txt
{'Status': True, 'Message': 'OK'}

Actual Behavior

Saved! 
Filename: test1.2
{'Status': True, 'Message': 'OK'}

Operating System

Ubuntu 18.04

Python Version

Python 3.6.8

Github Actions

Can we add Github actions to this repository so that the tasks about deploying packages and releases new packages can be much more easier?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.