ascii-art-python 3.0.0b2__tar.gz → 3.0.0b4__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.0b2/src/ascii_art_python.egg-info → ascii_art_python-3.0.0b4}/PKG-INFO +25 -12
  2. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/README.md +24 -11
  3. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/pyproject.toml +1 -1
  4. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/cli.py +16 -16
  5. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/tools/youtube.py +1 -0
  6. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4/src/ascii_art_python.egg-info}/PKG-INFO +25 -12
  7. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/LICENSE +0 -0
  8. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/MANIFEST.in +0 -0
  9. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/setup.cfg +0 -0
  10. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/__init__.py +0 -0
  11. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/_compat.py +0 -0
  12. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/ascii_base.py +0 -0
  13. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/assets/fonts/GoogleSansCode-Regular.ttf +0 -0
  14. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/assets/fonts/KreativeSquareSM.ttf +0 -0
  15. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/tools/__init__.py +0 -0
  16. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python/tools/terminal.py +0 -0
  17. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python.egg-info/SOURCES.txt +0 -0
  18. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python.egg-info/dependency_links.txt +0 -0
  19. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python.egg-info/entry_points.txt +0 -0
  20. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python.egg-info/requires.txt +0 -0
  21. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/src/ascii_art_python.egg-info/top_level.txt +0 -0
  22. {ascii_art_python-3.0.0b2 → ascii_art_python-3.0.0b4}/tests/test_ascii_base.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ascii_art_python
3
- Version: 3.0.0b2
3
+ Version: 3.0.0b4
4
4
  Summary: A Python library and CLI tool for converting images and videos into ASCII art.
5
5
  Author-email: Guillem Prieur <prieurguillem38@gmail.com>
6
6
  Project-URL: Homepage, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3
@@ -134,6 +134,9 @@ aap-echo my_image.jpg
134
134
 
135
135
  # Play a video with the 'old_skool' edges-only style
136
136
  aap-echo my_video.mp4 -m old_skool
137
+
138
+ # Play a video with the 'old_skool' edges-only style from Youtube
139
+ aap-echo "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -m old_skool
137
140
  ```
138
141
 
139
142
 
@@ -176,22 +179,32 @@ video.export(filename="my_ascii_video", sound=True, old_skool=True, new_skool=Tr
176
179
  ```
177
180
 
178
181
 
179
- ## Requirements
180
-
181
- - Python 3.9+
182
-
183
- - `opencv-python`
184
-
185
- - `numpy`
182
+ ## Prerequisites
186
183
 
187
- - `Pillow`
184
+ This program requires `ffmpeg` to process videos. Before using this script, make sure to install it on your system:
188
185
 
189
- - `moviepy`
186
+ - macOS:
187
+ ```bash
188
+ brew install ffmpeg
189
+ ```
190
190
 
191
- - `click`
191
+ - Windows:
192
+ ```powershell
193
+ winget install ffmpeg
194
+ # or
195
+ choco install ffmpeg
196
+ ```
192
197
 
193
- - `tqdm`
198
+ - Linux (Debian/Ubuntu):
199
+ ```bash
200
+ sudo apt update && sudo apt install ffmpeg
201
+ ```
194
202
 
203
+ - Linux (Fedora/Arch):
204
+ ```bash
205
+ sudo dnf install ffmpeg # Fedora
206
+ sudo pacman -S ffmpeg # Arch Linux
207
+ ```
195
208
 
196
209
  ## Full Documentation
197
210
 
@@ -92,6 +92,9 @@ aap-echo my_image.jpg
92
92
 
93
93
  # Play a video with the 'old_skool' edges-only style
94
94
  aap-echo my_video.mp4 -m old_skool
95
+
96
+ # Play a video with the 'old_skool' edges-only style from Youtube
97
+ aap-echo "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -m old_skool
95
98
  ```
96
99
 
97
100
 
@@ -134,22 +137,32 @@ video.export(filename="my_ascii_video", sound=True, old_skool=True, new_skool=Tr
134
137
  ```
135
138
 
136
139
 
137
- ## Requirements
138
-
139
- - Python 3.9+
140
-
141
- - `opencv-python`
142
-
143
- - `numpy`
140
+ ## Prerequisites
144
141
 
145
- - `Pillow`
142
+ This program requires `ffmpeg` to process videos. Before using this script, make sure to install it on your system:
146
143
 
147
- - `moviepy`
144
+ - macOS:
145
+ ```bash
146
+ brew install ffmpeg
147
+ ```
148
148
 
149
- - `click`
149
+ - Windows:
150
+ ```powershell
151
+ winget install ffmpeg
152
+ # or
153
+ choco install ffmpeg
154
+ ```
150
155
 
151
- - `tqdm`
156
+ - Linux (Debian/Ubuntu):
157
+ ```bash
158
+ sudo apt update && sudo apt install ffmpeg
159
+ ```
152
160
 
161
+ - Linux (Fedora/Arch):
162
+ ```bash
163
+ sudo dnf install ffmpeg # Fedora
164
+ sudo pacman -S ffmpeg # Arch Linux
165
+ ```
153
166
 
154
167
  ## Full Documentation
155
168
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ascii_art_python"
7
- version = "3.0.0b2"
7
+ version = "3.0.0b4"
8
8
  authors = [
9
9
  { name="Guillem Prieur", email="prieurguillem38@gmail.com" },
10
10
  ]
@@ -34,7 +34,7 @@ def _get_media_type(source_path: str) -> str:
34
34
  Returns
35
35
  -------
36
36
  str
37
- TODO
37
+ The type of media ("image", "video", or "YouTube")
38
38
 
39
39
  Raises
40
40
  ------
@@ -63,7 +63,7 @@ def _get_media_type(source_path: str) -> str:
63
63
  raise click.ClickException(f"Error: Unsupported media type '{media_type}'.")
64
64
 
65
65
  @click.command()
66
- @click.argument("source_path", type=click.STRING)
66
+ @click.argument("source_uri", type=click.STRING)
67
67
  @click.argument("target_filename", type=click.STRING)
68
68
  @click.option(
69
69
  "--width",
@@ -100,7 +100,7 @@ def _get_media_type(source_path: str) -> str:
100
100
  help="If the file is a video, export it with or without audio."
101
101
  )
102
102
  def create_and_export(
103
- source_path: str,
103
+ source_uri: str,
104
104
  target_filename: str,
105
105
  width: Optional[int],
106
106
  height: Optional[int],
@@ -114,19 +114,19 @@ def create_and_export(
114
114
  Processes the input file located at SOURCE_PATH and exports the result
115
115
  to TARGET_FILENAME with the specified settings.
116
116
  """
117
- click.echo(f"▶ Converting '{source_path}'...")
117
+ click.echo(f"▶ Converting '{source_uri}'...")
118
118
  click.echo(f"▶ Settings: length=({width}, {height}), mode={mode}")
119
119
 
120
- media_type = _get_media_type(source_path)
120
+ media_type = _get_media_type(source_uri)
121
121
  click.echo(f"▶ Export type: {media_type}")
122
122
 
123
123
  if media_type == "image":
124
- image = Image.from_path(source_path, height=height, width=width)
124
+ image = Image.from_path(source_uri, height=height, width=width)
125
125
  image.export(target_filename, font_size = fontsize, **MODES[mode])
126
126
  click.echo("✓ Conversion complete!")
127
127
 
128
128
  elif media_type == "video":
129
- video = Video(source_path, width=width, height=height)
129
+ video = Video(source_uri, width=width, height=height)
130
130
  click.echo(
131
131
  f"Please note: You are about to export a video with the following settings: "
132
132
  f"length=({video.width}, {video.height}) font_size={fontsize}"
@@ -147,9 +147,9 @@ def create_and_export(
147
147
  )
148
148
  click.confirm("Do you want to continue?", abort=True)
149
149
  if height is None:
150
- tools.youtube.export(source_path, target_filename, sound = sound)
150
+ tools.youtube.export(source_uri, target_filename, sound = sound)
151
151
  else:
152
- tools.youtube.export(source_path, target_filename, height, sound)
152
+ tools.youtube.export(source_uri, target_filename, height, sound)
153
153
  click.echo("✓ Conversion complete!")
154
154
  if sound:
155
155
  click.echo(f"✓ Your file is available here: {target_filename}_audio.mp4")
@@ -158,7 +158,7 @@ def create_and_export(
158
158
 
159
159
 
160
160
  @click.command()
161
- @click.argument("source_path", type=click.STRING)
161
+ @click.argument("source_uri", type=click.STRING)
162
162
  @click.option(
163
163
  "--mode",
164
164
  "-m",
@@ -166,7 +166,7 @@ def create_and_export(
166
166
  default="full_mode",
167
167
  help="The ASCII generation mode to use."
168
168
  )
169
- def create_and_echo(source_path: str, mode: str) -> None:
169
+ def create_and_echo(source_uri: str, mode: str) -> None:
170
170
  """
171
171
  Creates and prints an ASCII art image or video in the terminal.
172
172
 
@@ -174,20 +174,20 @@ def create_and_echo(source_path: str, mode: str) -> None:
174
174
  directly to the standard output.
175
175
  """
176
176
 
177
- click.echo(f"▶ Converting '{source_path}'...")
177
+ click.echo(f"▶ Converting '{source_uri}'...")
178
178
  click.echo(f"▶ Settings: mode={mode}")
179
179
 
180
- media_type = _get_media_type(source_path)
180
+ media_type = _get_media_type(source_uri)
181
181
  click.echo(f"▶ Echo type: {media_type}")
182
182
 
183
183
  if media_type == "image":
184
- image = Image.from_path(source_path)
184
+ image = Image.from_path(source_uri)
185
185
 
186
186
  click.echo(image.to_string(**MODES[mode], one_on_two = True))
187
187
  click.echo("✓ Conversion complete!")
188
188
 
189
189
  elif media_type == "video":
190
- video = Video(source_path, wanted_fps = 10)
190
+ video = Video(source_uri, wanted_fps = 10)
191
191
 
192
192
  click.clear()
193
193
  video.print_in_terminal(**MODES[mode], func_print = tools.terminal.clean_print)
@@ -195,5 +195,5 @@ def create_and_echo(source_path: str, mode: str) -> None:
195
195
 
196
196
  elif media_type == "youtube":
197
197
  click.clear()
198
- tools.youtube.echo(source_path, **MODES[mode], func_print = tools.terminal.clean_print)
198
+ tools.youtube.echo(source_uri, **MODES[mode], func_print = tools.terminal.clean_print)
199
199
  click.echo("✓ Conversion complete!")
@@ -37,6 +37,7 @@ def download(url: str, max_height: int = 144, target_folder: str = ".", target_f
37
37
  """
38
38
  ydl_opts = {
39
39
  "format": f"bestvideo[height<={max_height}]+bestaudio/best[height<={max_height}]",
40
+ "format_sort": ["codec:h264"],
40
41
  "outtmpl": os.path.join(
41
42
  target_folder,
42
43
  target_filename
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ascii_art_python
3
- Version: 3.0.0b2
3
+ Version: 3.0.0b4
4
4
  Summary: A Python library and CLI tool for converting images and videos into ASCII art.
5
5
  Author-email: Guillem Prieur <prieurguillem38@gmail.com>
6
6
  Project-URL: Homepage, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-3
@@ -134,6 +134,9 @@ aap-echo my_image.jpg
134
134
 
135
135
  # Play a video with the 'old_skool' edges-only style
136
136
  aap-echo my_video.mp4 -m old_skool
137
+
138
+ # Play a video with the 'old_skool' edges-only style from Youtube
139
+ aap-echo "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -m old_skool
137
140
  ```
138
141
 
139
142
 
@@ -176,22 +179,32 @@ video.export(filename="my_ascii_video", sound=True, old_skool=True, new_skool=Tr
176
179
  ```
177
180
 
178
181
 
179
- ## Requirements
180
-
181
- - Python 3.9+
182
-
183
- - `opencv-python`
184
-
185
- - `numpy`
182
+ ## Prerequisites
186
183
 
187
- - `Pillow`
184
+ This program requires `ffmpeg` to process videos. Before using this script, make sure to install it on your system:
188
185
 
189
- - `moviepy`
186
+ - macOS:
187
+ ```bash
188
+ brew install ffmpeg
189
+ ```
190
190
 
191
- - `click`
191
+ - Windows:
192
+ ```powershell
193
+ winget install ffmpeg
194
+ # or
195
+ choco install ffmpeg
196
+ ```
192
197
 
193
- - `tqdm`
198
+ - Linux (Debian/Ubuntu):
199
+ ```bash
200
+ sudo apt update && sudo apt install ffmpeg
201
+ ```
194
202
 
203
+ - Linux (Fedora/Arch):
204
+ ```bash
205
+ sudo dnf install ffmpeg # Fedora
206
+ sudo pacman -S ffmpeg # Arch Linux
207
+ ```
195
208
 
196
209
  ## Full Documentation
197
210