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.
Files changed (22) hide show
  1. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/LICENSE +21 -21
  2. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/MANIFEST.in +1 -1
  3. {ascii_art_python-3.0.0b1/src/ascii_art_python.egg-info → ascii_art_python-3.0.0b2}/PKG-INFO +203 -201
  4. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/README.md +161 -161
  5. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/pyproject.toml +72 -70
  6. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/setup.cfg +4 -4
  7. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/__init__.py +9 -8
  8. ascii_art_python-3.0.0b2/src/ascii_art_python/_compat.py +13 -0
  9. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/ascii_base.py +748 -701
  10. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/cli.py +199 -174
  11. ascii_art_python-3.0.0b2/src/ascii_art_python/tools/__init__.py +13 -0
  12. 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
  13. ascii_art_python-3.0.0b2/src/ascii_art_python/tools/youtube.py +71 -0
  14. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2/src/ascii_art_python.egg-info}/PKG-INFO +203 -201
  15. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/SOURCES.txt +4 -1
  16. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/requires.txt +6 -1
  17. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/tests/test_ascii_base.py +243 -243
  18. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/assets/fonts/GoogleSansCode-Regular.ttf +0 -0
  19. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python/assets/fonts/KreativeSquareSM.ttf +0 -0
  20. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/dependency_links.txt +0 -0
  21. {ascii_art_python-3.0.0b1 → ascii_art_python-3.0.0b2}/src/ascii_art_python.egg-info/entry_points.txt +0 -0
  22. {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 *
@@ -1,201 +1,203 @@
1
- Metadata-Version: 2.4
2
- Name: ascii_art_python
3
- Version: 3.0.0b1
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.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Programming Language :: Python :: 3.13
24
- Classifier: Programming Language :: Python :: 3.14
25
- Classifier: License :: OSI Approved :: MIT License
26
- Classifier: Operating System :: OS Independent
27
- Requires-Python: >=3.9
28
- Description-Content-Type: text/markdown
29
- License-File: LICENSE
30
- Requires-Dist: pillow>=10.0.0
31
- Requires-Dist: tqdm>=4.65.0
32
- Requires-Dist: opencv-python-headless>=4.8.0
33
- Requires-Dist: moviepy>=2.0.0
34
- Requires-Dist: numpy>=1.24.0
35
- Requires-Dist: click>=8.0.0
36
- Requires-Dist: importlib_resources; python_version < "3.10"
37
- Provides-Extra: dev
38
- Requires-Dist: pytest>=7.0.0; extra == "dev"
39
- Dynamic: license-file
40
-
41
- # ascii\_art\_python
42
-
43
- <div align="center">
44
-
45
- [![PyPI version](https://img.shields.io/pypi/v/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
46
- [![Python versions](https://img.shields.io/pypi/pyversions/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
47
- [![PyPI Downloads](https://img.shields.io/pypi/dm/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
48
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow)](https://opensource.org/licenses/MIT)
49
-
50
- </div>
51
-
52
- A powerful and flexible Python library and Command Line Interface (CLI) to convert your images and videos into stunning ASCII art.
53
-
54
- `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!
55
-
56
-
57
- ## Preview
58
-
59
- Below is an example of an image featuring the Python logo:
60
-
61
- ```
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
- And below, an example of a video featuring Nyan Cat:
88
-
89
- ![Example with the Nyan Cat video played.](https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3/-/raw/main/docs/example.gif)
90
-
91
-
92
- ## Features
93
-
94
- - **Image to ASCII:** Convert standard images (JPG, PNG, etc.) to ASCII strings or export them as PNG files.
95
-
96
- - **Video to ASCII:** Convert entire video files to ASCII animations (MP4 format) with original audio preserved.
97
-
98
- - **Command Line Interface:** Quickly convert files directly from your terminal.
99
-
100
- - **Three Rendering Modes:**
101
-
102
- - `full_mode`: Combines edge detection and background luminosity for highly detailed art.
103
-
104
- - `old_skool`: Uses directional characters based on edge detection (perfect for a "Matrix" look).
105
-
106
- - `new_skool`: Uses background characters mapped by luminosity.
107
-
108
- - **Terminal Playback:** Play ASCII videos or display images directly within your console.
109
-
110
-
111
- ## Installation
112
-
113
- Install the package easily via pip:
114
-
115
- ```bash
116
- pip install ascii_art_python
117
- ```
118
-
119
-
120
- ## Command Line Interface (CLI) Usage
121
-
122
- The library provides convenient commands to process your media right from the terminal.
123
-
124
-
125
- ### Display directly in the terminal
126
-
127
- Automatically resizes the output to fit your current terminal window.
128
-
129
- ```bash
130
- # Display an image (default full_mode)
131
- aap-echo my_image.jpg
132
-
133
- # Play a video with the 'old_skool' edges-only style
134
- aap-echo my_video.mp4 -m old_skool
135
- ```
136
-
137
-
138
- ### Export to a file
139
-
140
- Saves the ASCII output to your disk (`.png` for images, `.mp4` for videos).
141
-
142
- ```bash
143
- # Export an image with a specific width and 'new_skool' mode
144
- aap-export landscape.jpg landscape_ascii -w 150 -m new_skool
145
-
146
- # Export a complete video and keep the original audio track
147
- aap-export music_video.mp4 ascii_clip --sound -f 10
148
- ```
149
-
150
-
151
- ## Python API Usage
152
-
153
- You can also integrate `ascii_art_python` directly into your own Python scripts.
154
-
155
- ```python
156
- import ascii_art_python as aap
157
-
158
- # --- 1. Image Conversion ---
159
- # Load an image and set a target width
160
- img = aap.Image.from_path("my_image.jpg", width=120)
161
-
162
- # Print it to the console
163
- print(img.to_string(old_skool=True, new_skool=True, one_on_two=True))
164
-
165
- # Or export it as a PNG file
166
- img.export(filename="my_ascii_image", font_size=15, old_skool=True, new_skool=True)
167
-
168
- # --- 2. Video Conversion ---
169
- # Load a video (processing at 15 FPS)
170
- video = aap.Video("my_video.mp4", width=80, wanted_fps=15)
171
-
172
- # Export the video with sound (uses multiprocessing for speed)
173
- video.export(filename="my_ascii_video", sound=True, old_skool=True, new_skool=True)
174
- ```
175
-
176
-
177
- ## Requirements
178
-
179
- - Python 3.9+
180
-
181
- - `opencv-python`
182
-
183
- - `numpy`
184
-
185
- - `Pillow`
186
-
187
- - `moviepy`
188
-
189
- - `click`
190
-
191
- - `tqdm`
192
-
193
-
194
- ## Full Documentation
195
-
196
- To check the complete API, class details, and advanced export options, visit: [the doc](https://guill_prieur.site-prieur.fr/ascii-art-python-3/).
197
-
198
-
199
- ## License
200
-
201
- This project is licensed under the MIT License - see the LICENSE file for details.
1
+ Metadata-Version: 2.4
2
+ Name: ascii_art_python
3
+ Version: 3.0.0b2
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.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: License :: OSI Approved :: MIT License
27
+ Classifier: Operating System :: OS Independent
28
+ Requires-Python: >=3.8
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: pillow>=10.0.0
32
+ Requires-Dist: tqdm>=4.65.0
33
+ Requires-Dist: opencv-python-headless>=4.8.0
34
+ Requires-Dist: moviepy>=2.0.0; python_version >= "3.9"
35
+ Requires-Dist: numpy>=1.24.0
36
+ Requires-Dist: click>=8.0.0
37
+ Requires-Dist: importlib_resources; python_version < "3.10"
38
+ Requires-Dist: yt-dlp; python_version >= "3.10"
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
41
+ Dynamic: license-file
42
+
43
+ # ascii\_art\_python
44
+
45
+ <div align="center">
46
+
47
+ [![PyPI version](https://img.shields.io/pypi/v/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
48
+ [![Python versions](https://img.shields.io/pypi/pyversions/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
49
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
50
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow)](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
+ ![Example with the Nyan Cat video played.](https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3/-/raw/main/docs/example.gif)
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.