ascii-art-python 2.1.0__tar.gz → 3.0.0b0__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 (27) hide show
  1. ascii_art_python-3.0.0b0/PKG-INFO +201 -0
  2. ascii_art_python-3.0.0b0/README.md +161 -0
  3. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/pyproject.toml +6 -6
  4. ascii_art_python-3.0.0b0/src/ascii_art_python/__init__.py +8 -0
  5. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python/ascii_base.py +254 -210
  6. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python/cli.py +25 -33
  7. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python/tools.py +10 -1
  8. ascii_art_python-3.0.0b0/src/ascii_art_python.egg-info/PKG-INFO +201 -0
  9. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python.egg-info/SOURCES.txt +0 -3
  10. ascii_art_python-3.0.0b0/tests/test_ascii_api.py +187 -0
  11. ascii_art_python-2.1.0/PKG-INFO +0 -140
  12. ascii_art_python-2.1.0/README.md +0 -100
  13. ascii_art_python-2.1.0/src/ascii_art_python/__init__.py +0 -10
  14. ascii_art_python-2.1.0/src/ascii_art_python/full_mode.py +0 -82
  15. ascii_art_python-2.1.0/src/ascii_art_python/new_skool.py +0 -72
  16. ascii_art_python-2.1.0/src/ascii_art_python/old_skool.py +0 -74
  17. ascii_art_python-2.1.0/src/ascii_art_python.egg-info/PKG-INFO +0 -140
  18. ascii_art_python-2.1.0/tests/test_ascii_api.py +0 -219
  19. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/LICENSE +0 -0
  20. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/MANIFEST.in +0 -0
  21. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/setup.cfg +0 -0
  22. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python/assets/fonts/GoogleSansCode-Regular.ttf +0 -0
  23. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python/assets/fonts/KreativeSquareSM.ttf +0 -0
  24. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python.egg-info/dependency_links.txt +0 -0
  25. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python.egg-info/entry_points.txt +0 -0
  26. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python.egg-info/requires.txt +0 -0
  27. {ascii_art_python-2.1.0 → ascii_art_python-3.0.0b0}/src/ascii_art_python.egg-info/top_level.txt +0 -0
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.4
2
+ Name: ascii_art_python
3
+ Version: 3.0.0b0
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.
@@ -0,0 +1,161 @@
1
+ # ascii\_art\_python
2
+
3
+ <div align="center">
4
+
5
+ [![PyPI version](https://img.shields.io/pypi/v/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
6
+ [![Python versions](https://img.shields.io/pypi/pyversions/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
7
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/ascii-art-python)](https://pypi.org/project/ascii-art-python/)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow)](https://opensource.org/licenses/MIT)
9
+
10
+ </div>
11
+
12
+ A powerful and flexible Python library and Command Line Interface (CLI) to convert your images and videos into stunning ASCII art.
13
+
14
+ `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!
15
+
16
+
17
+ ## Preview
18
+
19
+ Below is an example of an image featuring the Python logo:
20
+
21
+ ```
22
+ ||=*|{||#&&&&||||||
23
+ /##--\&&&&&&&&&&$$&\\
24
+ |&&| |{&&&&&&&&&$$$$\
25
+ |&&\--/&&&&&&&&&$$$$$|
26
+ :\-#####---\&&$$$$$$$|
27
+ ------/;;;;;;;===|$$$$$$$$$| -----
28
+ /--##&&&&&----------/$$$$$$$$@| .:::::-\\
29
+ //#####&&&&&&&&&&&&$$$$$$$$$$$@| .:::::::\\
30
+ //&####&&&&&&&&&&&$$$$$$$$$$$$$@| .::::::::\
31
+ |####&&&&&&&&&&$$$$$$$$$@@@@@@@//.:::::::::|
32
+ |&#&&&&&&&&&$$-----------------..:::::::::::|
33
+ |&&&&&&&&&&//-.................:::::::::::::|
34
+ |&&&&&&&&&// ..::::::::::::::::::::::::::;;|
35
+ |&&&&&&&$| ::::::::::::::::::::::::::;;;;;/
36
+ \\&&&&&$$| :::::::::::::::::::::::;;;;;;;//
37
+ \\$$$$$@| ::::::::::::::::::;;;;;;;;;;;//
38
+ ------/ ::::::::::...........--------
39
+ ::::::::::\---::::--|/
40
+ |::::::::::::;;/--\;;|
41
+ |\::::::::;;;;;| |;;|
42
+ \\::::;;;;;;;;\--:;//
43
+ \---:;;;;;;;;;::--/
44
+ ------------
45
+ ```
46
+
47
+ And below, an example of a video featuring Nyan Cat:
48
+
49
+ ![Example with the Nyan Cat video played.](https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3/-/raw/main/docs/example.gif)
50
+
51
+
52
+ ## Features
53
+
54
+ - **Image to ASCII:** Convert standard images (JPG, PNG, etc.) to ASCII strings or export them as PNG files.
55
+
56
+ - **Video to ASCII:** Convert entire video files to ASCII animations (MP4 format) with original audio preserved.
57
+
58
+ - **Command Line Interface:** Quickly convert files directly from your terminal.
59
+
60
+ - **Three Rendering Modes:**
61
+
62
+ - `full_mode`: Combines edge detection and background luminosity for highly detailed art.
63
+
64
+ - `old_skool`: Uses directional characters based on edge detection (perfect for a "Matrix" look).
65
+
66
+ - `new_skool`: Uses background characters mapped by luminosity.
67
+
68
+ - **Terminal Playback:** Play ASCII videos or display images directly within your console.
69
+
70
+
71
+ ## Installation
72
+
73
+ Install the package easily via pip:
74
+
75
+ ```bash
76
+ pip install ascii_art_python
77
+ ```
78
+
79
+
80
+ ## Command Line Interface (CLI) Usage
81
+
82
+ The library provides convenient commands to process your media right from the terminal.
83
+
84
+
85
+ ### Display directly in the terminal
86
+
87
+ Automatically resizes the output to fit your current terminal window.
88
+
89
+ ```bash
90
+ # Display an image (default full_mode)
91
+ aap-echo my_image.jpg
92
+
93
+ # Play a video with the 'old_skool' edges-only style
94
+ aap-echo my_video.mp4 -m old_skool
95
+ ```
96
+
97
+
98
+ ### Export to a file
99
+
100
+ Saves the ASCII output to your disk (`.png` for images, `.mp4` for videos).
101
+
102
+ ```bash
103
+ # Export an image with a specific width and 'new_skool' mode
104
+ aap-export landscape.jpg landscape_ascii -w 150 -m new_skool
105
+
106
+ # Export a complete video and keep the original audio track
107
+ aap-export music_video.mp4 ascii_clip --sound -f 10
108
+ ```
109
+
110
+
111
+ ## Python API Usage
112
+
113
+ You can also integrate `ascii_art_python` directly into your own Python scripts.
114
+
115
+ ```python
116
+ import ascii_art_python as aap
117
+
118
+ # --- 1. Image Conversion ---
119
+ # Load an image and set a target width
120
+ img = aap.Image.from_path("my_image.jpg", width=120)
121
+
122
+ # Print it to the console
123
+ print(img.to_string(old_skool=True, new_skool=True, one_on_two=True))
124
+
125
+ # Or export it as a PNG file
126
+ img.export(filename="my_ascii_image", font_size=15, old_skool=True, new_skool=True)
127
+
128
+ # --- 2. Video Conversion ---
129
+ # Load a video (processing at 15 FPS)
130
+ video = aap.Video("my_video.mp4", width=80, wanted_fps=15)
131
+
132
+ # Export the video with sound (uses multiprocessing for speed)
133
+ video.export(filename="my_ascii_video", sound=True, old_skool=True, new_skool=True)
134
+ ```
135
+
136
+
137
+ ## Requirements
138
+
139
+ - Python 3.9+
140
+
141
+ - `opencv-python`
142
+
143
+ - `numpy`
144
+
145
+ - `Pillow`
146
+
147
+ - `moviepy`
148
+
149
+ - `click`
150
+
151
+ - `tqdm`
152
+
153
+
154
+ ## Full Documentation
155
+
156
+ To check the complete API, class details, and advanced export options, visit: [the doc](https://guill_prieur.site-prieur.fr/ascii-art-python-3/).
157
+
158
+
159
+ ## License
160
+
161
+ This project is licensed under the MIT License - see the LICENSE file for details.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ascii_art_python"
7
- version = "2.1.0"
7
+ version = "3.0.0b0"
8
8
  authors = [
9
9
  { name="Guillem Prieur", email="prieurguillem38@gmail.com" },
10
10
  ]
@@ -26,7 +26,7 @@ keywords = [
26
26
  ]
27
27
 
28
28
  classifiers = [
29
- "Development Status :: 5 - Production/Stable",
29
+ "Development Status :: 4 - Beta",
30
30
  "Intended Audience :: Developers",
31
31
  "Intended Audience :: End Users/Desktop",
32
32
  "Topic :: Multimedia :: Graphics",
@@ -60,10 +60,10 @@ dev = [
60
60
  ]
61
61
 
62
62
  [project.urls]
63
- "Homepage" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-2"
64
- "Bug Tracker" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-2/-/issues"
65
- "Source Code" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-2"
66
- "Documentation" = "https://guill_prieur.site-prieur.fr/ascii-art-python-2"
63
+ "Homepage" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3"
64
+ "Bug Tracker" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3/-/issues"
65
+ "Source Code" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3"
66
+ "Documentation" = "https://guill_prieur.site-prieur.fr/ascii-art-python-3"
67
67
 
68
68
  [project.scripts]
69
69
  aap-export = "ascii_art_python.cli:create_and_export"
@@ -0,0 +1,8 @@
1
+ """
2
+ Module from https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-2
3
+ """
4
+ __version__ = "3.0.0"
5
+ from .ascii_base import Image, Video
6
+
7
+ if __name__ == "__main__":
8
+ print(Image.from_string("ASCII Art", 15))