ascii-art-python 3.0.0b1__tar.gz → 3.0.0b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/LICENSE +21 -21
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/MANIFEST.in +1 -1
- {ascii_art_python-3.0.0b1/src/ascii_art_python.egg-info → ascii_art_python-3.0.0b2}/PKG-INFO +203 -201
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/README.md +161 -161
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/pyproject.toml +72 -70
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/setup.cfg +4 -4
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/__init__.py +9 -8
- ascii_art_python-3.0.0b2/src/ascii_art_python/_compat.py +13 -0
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/ascii_base.py +748 -701
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/cli.py +199 -174
- ascii_art_python-3.0.0b2/src/ascii_art_python/tools/__init__.py +13 -0
- ascii_art_python-3.0.0b1/src/ascii_art_python/tools.py → ascii_art_python-3.0.0b2/src/ascii_art_python/tools/terminal.py +20 -20
- ascii_art_python-3.0.0b2/src/ascii_art_python/tools/youtube.py +71 -0
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2/src/ascii_art_python.egg-info}/PKG-INFO +203 -201
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/SOURCES.txt +4 -1
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/requires.txt +6 -1
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/tests/test_ascii_base.py +243 -243
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/assets/fonts/GoogleSansCode-Regular.ttf +0 -0
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/assets/fonts/KreativeSquareSM.ttf +0 -0
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/dependency_links.txt +0 -0
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/entry_points.txt +0 -0
- {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/top_level.txt +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Guillem Prieur
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Guillem Prieur
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
recursive-include src/ascii_art_python/assets/fonts *
|
|
1
|
+
recursive-include src/ascii_art_python/assets/fonts *
|
{ascii_art_python-3.0.0b1/src/ascii_art_python.egg-info → ascii_art_python-3.0.0b2}/PKG-INFO
RENAMED
|
@@ -1,201 +1,203 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ascii_art_python
|
|
3
|
-
Version: 3.0.
|
|
4
|
-
Summary: A Python library and CLI tool for converting images and videos into ASCII art.
|
|
5
|
-
Author-email: Guillem Prieur <prieurguillem38@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3
|
|
7
|
-
Project-URL: Bug Tracker, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3/-/issues
|
|
8
|
-
Project-URL: Source Code, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3
|
|
9
|
-
Project-URL: Documentation, https://guill_prieur.site-prieur.fr/ascii-art-python-3
|
|
10
|
-
Keywords: ascii,ascii-art,image-to-ascii,video-to-ascii,cli,terminal,terminal-graphics,generator,converter
|
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
-
Classifier: Topic :: Multimedia :: Graphics
|
|
15
|
-
Classifier: Topic :: Multimedia :: Video
|
|
16
|
-
Classifier: Topic :: Terminals
|
|
17
|
-
Classifier: Environment :: Console
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.
|
|
25
|
-
Classifier:
|
|
26
|
-
Classifier:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
[](https://pypi.org/project/ascii-art-python/)
|
|
48
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
49
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
50
|
+
[](https://opensource.org/licenses/MIT)
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
A powerful and flexible Python library and Command Line Interface (CLI) to convert your images and videos into stunning ASCII art.
|
|
55
|
+
|
|
56
|
+
`ascii_art_python` uses advanced edge detection (via OpenCV) and luminosity mapping to generate high-quality ASCII representations. It supports multiprocessing for fast video conversion and even transfers original audio tracks to your ASCII videos!
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Preview
|
|
60
|
+
|
|
61
|
+
Below is an example of an image featuring the Python logo:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
||=*|{||#&&&&||||||
|
|
65
|
+
/##--\&&&&&&&&&&$$&\\
|
|
66
|
+
|&&| |{&&&&&&&&&$$$$\
|
|
67
|
+
|&&\--/&&&&&&&&&$$$$$|
|
|
68
|
+
:\-#####---\&&$$$$$$$|
|
|
69
|
+
------/;;;;;;;===|$$$$$$$$$| -----
|
|
70
|
+
/--##&&&&&----------/$$$$$$$$@| .:::::-\\
|
|
71
|
+
//#####&&&&&&&&&&&&$$$$$$$$$$$@| .:::::::\\
|
|
72
|
+
//&####&&&&&&&&&&&$$$$$$$$$$$$$@| .::::::::\
|
|
73
|
+
|####&&&&&&&&&&$$$$$$$$$@@@@@@@//.:::::::::|
|
|
74
|
+
|&#&&&&&&&&&$$-----------------..:::::::::::|
|
|
75
|
+
|&&&&&&&&&&//-.................:::::::::::::|
|
|
76
|
+
|&&&&&&&&&// ..::::::::::::::::::::::::::;;|
|
|
77
|
+
|&&&&&&&$| ::::::::::::::::::::::::::;;;;;/
|
|
78
|
+
\\&&&&&$$| :::::::::::::::::::::::;;;;;;;//
|
|
79
|
+
\\$$$$$@| ::::::::::::::::::;;;;;;;;;;;//
|
|
80
|
+
------/ ::::::::::...........--------
|
|
81
|
+
::::::::::\---::::--|/
|
|
82
|
+
|::::::::::::;;/--\;;|
|
|
83
|
+
|\::::::::;;;;;| |;;|
|
|
84
|
+
\\::::;;;;;;;;\--:;//
|
|
85
|
+
\---:;;;;;;;;;::--/
|
|
86
|
+
------------
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
And below, an example of a video featuring Nyan Cat:
|
|
90
|
+
|
|
91
|
+

|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## Features
|
|
95
|
+
|
|
96
|
+
- **Image to ASCII:** Convert standard images (JPG, PNG, etc.) to ASCII strings or export them as PNG files.
|
|
97
|
+
|
|
98
|
+
- **Video to ASCII:** Convert entire video files to ASCII animations (MP4 format) with original audio preserved.
|
|
99
|
+
|
|
100
|
+
- **Command Line Interface:** Quickly convert files directly from your terminal.
|
|
101
|
+
|
|
102
|
+
- **Three Rendering Modes:**
|
|
103
|
+
|
|
104
|
+
- `full_mode`: Combines edge detection and background luminosity for highly detailed art.
|
|
105
|
+
|
|
106
|
+
- `old_skool`: Uses directional characters based on edge detection (perfect for a "Matrix" look).
|
|
107
|
+
|
|
108
|
+
- `new_skool`: Uses background characters mapped by luminosity.
|
|
109
|
+
|
|
110
|
+
- **Terminal Playback:** Play ASCII videos or display images directly within your console.
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## Installation
|
|
114
|
+
|
|
115
|
+
Install the package easily via pip:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
pip install ascii_art_python
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## Command Line Interface (CLI) Usage
|
|
123
|
+
|
|
124
|
+
The library provides convenient commands to process your media right from the terminal.
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Display directly in the terminal
|
|
128
|
+
|
|
129
|
+
Automatically resizes the output to fit your current terminal window.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Display an image (default full_mode)
|
|
133
|
+
aap-echo my_image.jpg
|
|
134
|
+
|
|
135
|
+
# Play a video with the 'old_skool' edges-only style
|
|
136
|
+
aap-echo my_video.mp4 -m old_skool
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Export to a file
|
|
141
|
+
|
|
142
|
+
Saves the ASCII output to your disk (`.png` for images, `.mp4` for videos).
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Export an image with a specific width and 'new_skool' mode
|
|
146
|
+
aap-export landscape.jpg landscape_ascii -w 150 -m new_skool
|
|
147
|
+
|
|
148
|
+
# Export a complete video and keep the original audio track
|
|
149
|
+
aap-export music_video.mp4 ascii_clip --sound -f 10
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## Python API Usage
|
|
154
|
+
|
|
155
|
+
You can also integrate `ascii_art_python` directly into your own Python scripts.
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
import ascii_art_python as aap
|
|
159
|
+
|
|
160
|
+
# --- 1. Image Conversion ---
|
|
161
|
+
# Load an image and set a target width
|
|
162
|
+
img = aap.Image.from_path("my_image.jpg", width=120)
|
|
163
|
+
|
|
164
|
+
# Print it to the console
|
|
165
|
+
print(img.to_string(old_skool=True, new_skool=True, one_on_two=True))
|
|
166
|
+
|
|
167
|
+
# Or export it as a PNG file
|
|
168
|
+
img.export(filename="my_ascii_image", font_size=15, old_skool=True, new_skool=True)
|
|
169
|
+
|
|
170
|
+
# --- 2. Video Conversion ---
|
|
171
|
+
# Load a video (processing at 15 FPS)
|
|
172
|
+
video = aap.Video("my_video.mp4", width=80, wanted_fps=15)
|
|
173
|
+
|
|
174
|
+
# Export the video with sound (uses multiprocessing for speed)
|
|
175
|
+
video.export(filename="my_ascii_video", sound=True, old_skool=True, new_skool=True)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
## Requirements
|
|
180
|
+
|
|
181
|
+
- Python 3.9+
|
|
182
|
+
|
|
183
|
+
- `opencv-python`
|
|
184
|
+
|
|
185
|
+
- `numpy`
|
|
186
|
+
|
|
187
|
+
- `Pillow`
|
|
188
|
+
|
|
189
|
+
- `moviepy`
|
|
190
|
+
|
|
191
|
+
- `click`
|
|
192
|
+
|
|
193
|
+
- `tqdm`
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
## Full Documentation
|
|
197
|
+
|
|
198
|
+
To check the complete API, class details, and advanced export options, visit: [the doc](https://guill_prieur.site-prieur.fr/ascii-art-python-3/).
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
## License
|
|
202
|
+
|
|
203
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|