Skip to content

Commit

Permalink
Merge pull request #42 from sepandhaghighi/dev
Browse files Browse the repository at this point in the history
Version 3.4
  • Loading branch information
sepandhaghighi authored Apr 20, 2019
2 parents e68c678 + 7527303 commit c5b0409
Show file tree
Hide file tree
Showing 13 changed files with 938 additions and 80 deletions.
4 changes: 3 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Please consider the following :
1. Fork it!
2. Create your feature branch (under `dev` branch)
3. Add standard `docstring` to your functions
4. Add tests for new features (`doctest` testcases in `test.py`)
4. Add tests for new features (`doctest` testcases)
- Non-ASCII fonts in `test2.py`
- Other in `test.py`
5. Pass all CI tests
6. Update `CHANGELOG.md`
- Describe changes under `[Unreleased]` section
Expand Down
2 changes: 1 addition & 1 deletion ArtList.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Version : 3.3"
"### Version : 3.4"
]
},
{
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [3.4] - 2019-04-20
### Added
- 7 new fonts
1. white_bubble
2. smallcaps2
3. superscript
4. subscript
5. full_width
6. currency
7. antrophobia
- `text2art` function support of `\n`
- `rnd-na` mode
### Changed
- `tprint` function modified
- `tsave` function modified
- `README.md` modified
- `random` mode modified
## [3.3] - 2019-04-10
### Added
- 3 new fonts
Expand Down Expand Up @@ -886,7 +903,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 1-Line art
- CLI commands

[Unreleased]: https://github.com/sepandhaghighi/art/compare/v3.3...dev
[Unreleased]: https://github.com/sepandhaghighi/art/compare/v3.4...dev
[3.4]: https://github.com/sepandhaghighi/art/compare/v3.3...v3.4
[3.3]: https://github.com/sepandhaghighi/art/compare/v3.2...v3.3
[3.2]: https://github.com/sepandhaghighi/art/compare/v3.1...v3.2
[3.1]: https://github.com/sepandhaghighi/art/compare/v3.0...v3.1
Expand Down
27 changes: 24 additions & 3 deletions FontList.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Version : 3.3"
"### Version : 3.4"
]
},
{
Expand All @@ -38,7 +38,7 @@
{
"data": {
"text/plain": [
"378"
"385"
]
},
"execution_count": 2,
Expand All @@ -61,7 +61,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"⚠️ Some environments don't support all fonts"
"⚠️ From `Version 3.3` Non-ASCII fonts added (These fonts are not compatible with some environments)"
]
},
{
Expand Down Expand Up @@ -403,6 +403,9 @@
" ',,' ',,'',,' ',,'',,' ',,' ',,' ',,,,,,' ',,,,,,' \n",
" \n",
"\n",
"antrophobia : \n",
"тєѕт123\n",
"\n",
"aquaplan : \n",
" ###### ###### #### ###### ## #### #### \n",
" ## ## ## ## ## ## ## ## ## ## \n",
Expand Down Expand Up @@ -1214,6 +1217,9 @@
" `---' `-------'`-------' `---' `---'`-------'`-------'\n",
" \n",
"\n",
"currency : \n",
"₮Ɇ₴₮123\n",
"\n",
"cyberlarge : \n",
" _______ _______ _______ _______\n",
" | |______ |______ | \n",
Expand Down Expand Up @@ -1677,6 +1683,9 @@
" \n",
" \n",
"\n",
"full_width : \n",
"TEST123\n",
"\n",
"funface : \n",
"(o)__(o) oo_ (o)__(o) 123\n",
"(__ __) wWw / _)-< (__ __) \n",
Expand Down Expand Up @@ -2833,6 +2842,9 @@
" )_( )___( )____) )_( /__( /___\\ (___/ \n",
" \n",
"\n",
"smallcaps2 : \n",
"TEST123\n",
"\n",
"smisome1 : \n",
" ___ ___ ___ ___ \n",
" /\\ \\ /\\ \\ /\\ \\ /\\ \\ \n",
Expand Down Expand Up @@ -2987,6 +2999,12 @@
" \\/_/ \\/_____/ \\/_____/ \\/_/ \n",
" \n",
"\n",
"subscript : \n",
"TEST123\n",
"\n",
"superscript : \n",
"ᵀᴱˢᵀ¹²³\n",
"\n",
"swampland : \n",
" _________ ______ ______ _________ ____ _____ ______ \n",
"/________/\\ /_____/\\ /_____/\\ /________/\\ /___/\\ /_____/\\ /_____/\\ \n",
Expand Down Expand Up @@ -3366,6 +3384,9 @@
" \n",
" \n",
"\n",
"white_bubble : \n",
"ⓉⒺⓈⓉ①②③\n",
"\n",
"wow : \n",
"`][` ]E ((5 `][` 123\n",
"\n",
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## Installation

### Source code
- Download [Version 3.3](https://github.com/sepandhaghighi/art/archive/v3.3.zip) or [Latest Source ](https://github.com/sepandhaghighi/art/archive/dev.zip)
- Download [Version 3.4](https://github.com/sepandhaghighi/art/archive/v3.4.zip) or [Latest Source ](https://github.com/sepandhaghighi/art/archive/dev.zip)
- `python3 setup.py install` or `python setup.py install` (Need root access)

### PyPI


- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- `pip install art==3.3` or `pip3 install art==3.3` (Need root access)
- `pip install art==3.4` or `pip3 install art==3.4` (Need root access)

* Note : On `--upgrade` error install latest version of `setuptools` : `pip install setuptools` and retry

Expand All @@ -19,4 +19,4 @@

### Easy install

- Run `easy_install "art==3.3"` (Need root access)
- Run `easy_install "art==3.4"` (Need root access)
74 changes: 60 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</a>
<a href="https://badge.fury.io/py/art"><img src="https://badge.fury.io/py/art.svg" alt="PyPI version" height="18"></a>
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3" /></a>
<a href="https://github.com/sepandhaghighi/art/blob/master/FontList.ipynb"><img src="https://img.shields.io/badge/Font List-378-blue.svg"></a>
<a href="https://github.com/sepandhaghighi/art/blob/master/FontList.ipynb"><img src="https://img.shields.io/badge/Font List-385-blue.svg"></a>
<a href="https://github.com/sepandhaghighi/art/blob/master/ArtList.ipynb"><img src="https://img.shields.io/badge/Art List-350-orange.svg"></a>
<a href="https://t.me/artlib_bot" target="__blank"><img src="https://img.shields.io/badge/Telegram-Bot-red.svg"></a>
<a href="https://anaconda.org/sepandhaghighi/art"><img src="https://anaconda.org/sepandhaghighi/art/badges/version.svg"></a>
Expand Down Expand Up @@ -64,7 +64,7 @@ ART is a Python lib for text converting to ASCII art fancy. ;-)
</tr>
<tr>
<td align="center">Font Counter</td>
<td align="center">378</td>
<td align="center">385</td>
</tr>
<tr>
<td align="center">1-Line-Art Counter</td>
Expand Down Expand Up @@ -176,13 +176,13 @@ art.art.artError: number should have int type

⚠️ Some fonts don't support all characters

⚠️ Some environments don't support all fonts
⚠️ From `Version 3.3` Non-ASCII fonts added (These fonts are not compatible with some environments)

#### 1. text2art

This function return ascii text as `str` in normal mode and raise `artError` in exception.
This function return ASCII text as `str` in normal mode and raise `artError` in exception.
```pycon
>>> Art=text2art("art") # Return ascii text (default font) and default chr_ignore=True
>>> Art=text2art("art") # Return ASCII text (default font) and default chr_ignore=True
>>> print(Art)
_
__ _ _ __ | |_
Expand All @@ -191,7 +191,7 @@ This function return ascii text as `str` in normal mode and raise `artError` in
\__,_||_| \__|


>>> Art=text2art("art",font='block',chr_ignore=True) # Return ascii text with block font
>>> Art=text2art("art",font='block',chr_ignore=True) # Return ASCII text with block font
>>> print(Art)


Expand Down Expand Up @@ -219,6 +219,28 @@ ___ ____ ____ ___
| |___ [__ |
| |___ ___] |

>>> 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):
...
Expand All @@ -227,17 +249,17 @@ art.art.artError: س is invalid
```
#### 2. tprint

This function print ascii text in normal mode (return None) and raise `artError` in exception.
This function print ASCII text in normal mode (return None) and raise `artError` in exception.
```pycon
>>> tprint("art") # print ascii text (default font)
>>> tprint("art") # print ASCII text (default font)
_
__ _ _ __ | |_
/ _` || '__|| __|
| (_| || | | |_
\__,_||_| \__|


>>> tprint("art",font="block",chr_ignore=True) # print ascii text (block font)
>>> tprint("art",font="block",chr_ignore=True) # print ASCII text (block font)

.----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. |
Expand Down Expand Up @@ -273,9 +295,9 @@ ___ ____ ____ ___
Traceback (most recent call last):
...
art.art.artError: س is invalid
>>> tprint('''Lorem # Multi-line print
>>> tprint('''Lorem
ipsum
dolor''', font="cybermedium")
dolor''', font="cybermedium") # Multi-line print
_ ____ ____ ____ _ _
| | | |__/ |___ |\/|
|___ |__| | \ |___ | |
Expand All @@ -294,12 +316,12 @@ ___ ____ _ ____ ____

This function return `dict` in normal and exception mode.
```pycon
>>> Response=tsave("art",filename="test.txt") # save ascii text in test.txt file with save message (print_status==True) # return dict
>>> 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=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"]
Expand Down Expand Up @@ -333,6 +355,9 @@ These modes are available for `text2art`, `tprint` & `tsave`.
| '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------'

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

```

#### 2. Random
Expand Down Expand Up @@ -446,7 +471,7 @@ Keywords : `rnd-xlarge`, `random-xlarge` & `rand-xlarge`

```

#### 6. Wizard
#### 7. Wizard

This mode consider length of input text to select font

Expand Down Expand Up @@ -492,6 +517,25 @@ d88P d88P d88P d88P d88P

```

#### 8. Random Non-ASCII

Randomly select from Non-ASCII fonts.

Keywords : `random-na`, `rand-na` & `rnd-na`

* Note : New in `Version 3.4`

```pycon
>>> tprint("test","random-na")
₮Ɇ₴₮

>>> tprint("test","random-na")
ʇsǝʇ

```
⚠️ Non-ASCII fonts are only available in `Font name` and `Random Non-ASCII` modes


### Typo-tolerance
<a href="https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein distance</a> used in this project. (`Version` >0.9)

Expand Down Expand Up @@ -666,6 +710,8 @@ or send an email to [sepand.haghighi@yahoo.com](mailto:sepand.haghighi@yahoo.com
3. [ASCII Generator](http://www.network-science.de/ascii/)
4. [Asky](https://asky.io/)
5. [Flipyourtext](https://www.flipyourtext.com/)
6. [YayText](https://yaytext.com)
7. [Coolletters](http://www.coolletters.net/)

## Donate to our project
Expand Down
Loading

0 comments on commit c5b0409

Please sign in to comment.