An open API service indexing awesome lists of open source software.

https://github.com/dhondta/python-asciistuff

:art: Library for producing ASCII arts
https://github.com/dhondta/python-asciistuff

ascii-art ascii-graphics cli development programming

Last synced: 4 months ago
JSON representation

:art: Library for producing ASCII arts

Awesome Lists containing this project

README

        


ASCIIstuff Tweet


Make a styled banner for your CLI tool.

[![PyPi](https://img.shields.io/pypi/v/asciistuff.svg)](https://pypi.python.org/pypi/asciistuff/)
[![Read The Docs](https://readthedocs.org/projects/python-asciistuff/badge/?version=latest)](https://python-asciistuff.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://github.com/dhondta/python-asciistuff/actions/workflows/python-package.yml/badge.svg)](https://github.com/dhondta/python-asciistuff/actions/workflows/python-package.yml)
[![Coverage Status](https://raw.githubusercontent.com/dhondta/python-asciistuff/main/docs/coverage.svg)](#)
[![Python Versions](https://img.shields.io/pypi/pyversions/asciistuff.svg)](https://pypi.python.org/pypi/asciistuff/)
[![Known Vulnerabilities](https://snyk.io/test/github/dhondta/python-asciistuff/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/dhondta/python-asciistuff?targetFile=requirements.txt)
[![License](https://img.shields.io/pypi/l/asciistuff.svg)](https://pypi.python.org/pypi/asciistuff/)

This library gathers some useful ASCII art features relying on [PyFiglet](https://github.com/pwaller/pyfiglet/), [Pillow](https://github.com/python-pillow/Pillow/) and [cowpy](https://github.com/jeffbuttars/cowpy/).

```sh
pip install asciistuff
```

## :sunglasses: Usage

### Banner

Creating a banner:

```
>>> from asciistuff import Banner
>>> print(Banner("Test"))
'########:'########::'######::'########:
... ##..:: ##.....::'##... ##:... ##..::
::: ##:::: ##::::::: ##:::..::::: ##::::
::: ##:::: ######:::. ######::::: ##::::
::: ##:::: ##...:::::..... ##:::: ##::::
::: ##:::: ##:::::::'##::: ##:::: ##::::
::: ##:::: ########:. ######::::: ##::::
:::..:::::........:::......::::::..:::::

```

### Image

```
>>> from asciistuff import Image
>>> print(Image("hello.png", 80))
@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@(/,,,,,,/(@@@@@@@@@@ @@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@ @@@@@@(,.. .,*@@@@@@ @@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@* @@@@@/.. .,**((%%#####%((*/,. .,*@@@ @@@@@@@@@@@@@@
@@@@@@@@@@@@@@@* @@@/. ,/(%###%%(*//,,,,,//**%####%((/. .,@@@ @@@@@@@@@@@@
@@@@@@@@@@@@@@ @@*. ,(###%(/,. .,/*(%##%, ,@@ @@@@@@@@@@@
@@@@@@@@@@@@ @@/. *#@#(/. ,(@#/ ./@ @@@@@@@@@@
@@@@@@@@@@@ @@. .(@#*. .(@%. ,@ @@@@@@@@@
@@@@@@@@@@ @/. *@#/ .#@/ .@ @@@@@@@@
@@@@@@@@@ @, .%@( /%. (@* ,@ @@@@@@@
@@@@@@@@ @, /@#, *#. (@, (@/ /@ @@@@@@
@@@@@@@ @, /@#. .. *@, *@, .#@. .(@ @@@@@
@@@@@@ @/ /@#. (@, ,@/ /@, /((/. .@%. ,@ @@@@@
@@@@@@ @. .#@, ,@* .@( ,@/ .%@(*#@/ %@. .@ @@@@@
@@@@@ @/ *@* ## ,%##* #% ,@* %@. %@, %@. .@ @@@@@
@@@@@ @. .##. (@(%##(, /#(.,@(. %# .@( .@( ,@* %@. ,@ @@@@@
@@@@@@@. /@( /@#/.,%@/ ,@(,*(#@( (@. ## .@( %@. ## ,@ @@@@@
@@@@@@@. /@( .@% #@. #@#%(/,. /@, (@. %@/./#@/ .@% /@ @@@@@
@@@@@@@. ,@( ## /@* @% /@/ *@/ .(###(. *@/ .%@ @@@@@
@@@@@ @. .@# %@. ##.@% ,@( ,@( ,@% .@ @@@@@@
@@@@@ @, %@. (@. (@./@#*(##( ## */ ,##. .( @@@@@@
@@@@@ @(. ,@% (@/ *@, .*((/.. (@/ *@%. /@ @@@@@@@
@@@@@@ @, (@/ ./. ,@* .*, /#@* ./@ @@@@@@@@
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@@@@@@@@@. ,%* .,@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @, .%@ *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*,*%@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
```

### Lolcat

![](https://raw.githubusercontent.com/dhondta/python-asciistuff/main/docs/pages/img/lolcat-example.png)

### Quote

```
>>> from asciistuff import AsciiQuote
>>> print(AsciiQuote("This is a nice quote", "me"))
"This is a nice quote",
me
```

```
>>> from asciistuff import Quote
>>> print(Quote("This is another nice quote", "John Doe", cowsay="random"))
_______________________________
/ "This is another nice quote", \
\ John Doe /
-------------------------------
\
\
^__^ /
(oo)\_______/ _________
(__)\ )=( ____|_ \_____
||----w | \ \ \_____ |
|| || || ||
```

### File

```
from asciistuff import *

file = AsciiFile("test.asc")

```

## :clap: Supporters

[![Stargazers repo roster for @dhondta/python-asciistuff](https://reporoster.com/stars/dark/dhondta/python-asciistuff)](https://github.com/dhondta/python-asciistuff/stargazers)

[![Forkers repo roster for @dhondta/python-asciistuff](https://reporoster.com/forks/dark/dhondta/python-asciistuff)](https://github.com/dhondta/python-asciistuff/network/members)

Back to top