anime-ctl 0.1.1__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.
@@ -0,0 +1,474 @@
1
+ Metadata-Version: 2.4
2
+ Name: anime-ctl
3
+ Version: 0.1.1
4
+ Summary: CLI for managing and watching anime
5
+ License: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: platformdirs
9
+ Requires-Dist: windows-curses; platform_system == "Windows"
10
+ Requires-Dist: httpx
11
+ Requires-Dist: requests
12
+
13
+ # anime-cli
14
+
15
+ A terminal-based anime manager and player for organizing and watching anime episodes.
16
+
17
+ `anime-cli` can organize episode files into the structure expected by the application, search MyAnimeList for anime information, and launch episodes through VLC.
18
+
19
+ ## Features
20
+
21
+ * Browse your anime collection from the terminal.
22
+ * Play episodes using VLC.
23
+ * Keep track of watched episodes.
24
+ * Organize episode filenames.
25
+ * Rename an existing series directory with `--rename`.
26
+ * Search MyAnimeList for anime information through the project's hosted API.
27
+ * Store application configuration outside the project directory.
28
+ * Terminal interface using `curses`.
29
+
30
+ ## Requirements
31
+
32
+ * Python 3.10 or newer
33
+ * VLC
34
+ * `pipx`
35
+ * Internet access for MAL-related features
36
+
37
+ VLC must be available as an executable on your system.
38
+
39
+ ### Linux
40
+
41
+ On Arch Linux:
42
+
43
+ ```bash
44
+ sudo pacman -S vlc python-pipx
45
+ ```
46
+
47
+ Then make sure `pipx` applications are available on your `PATH`:
48
+
49
+ ```bash
50
+ pipx ensurepath
51
+ ```
52
+
53
+ Restart your shell after running `pipx ensurepath`.
54
+
55
+ ### Windows
56
+
57
+ Install Python, VLC, and `pipx`. Make sure both Python and VLC are available to the application.
58
+
59
+ ## Installation
60
+
61
+ `anime-cli` is installed with `pipx`, which keeps the application's Python dependencies isolated while making the `anime` command available globally.
62
+
63
+ ### From PyPI
64
+
65
+ Once the package is published:
66
+
67
+ ```bash
68
+ pipx install anime-cli
69
+ ```
70
+
71
+ After installation, run:
72
+
73
+ ```bash
74
+ anime
75
+ ```
76
+
77
+ The command works regardless of your current directory.
78
+
79
+ ### From a local wheel
80
+
81
+ To install a locally built version:
82
+
83
+ ```bash
84
+ pipx install ./dist/anime_cli-0.1.0-py3-none-any.whl
85
+ ```
86
+
87
+ You can then use:
88
+
89
+ ```bash
90
+ anime
91
+ ```
92
+
93
+ from any directory.
94
+
95
+ ## Usage
96
+
97
+ ### Open the anime menu
98
+
99
+ ```bash
100
+ anime
101
+ ```
102
+
103
+ This opens the main menu where you can browse your configured anime directory.
104
+
105
+ ### Menu commands
106
+
107
+ Press `:` in a menu to open its internal command line. The following commands
108
+ are currently available:
109
+
110
+ * `open <entry>` (or `o`) — open an entry by its one-based menu number or exact name;
111
+ for example, `open 2` or `open Nisekoi`. From an episode-selection menu,
112
+ this switches to the named anime in the collection.
113
+ * `play <anime> [episode]` (or `p`) — from the anime-selection menu, play an
114
+ anime from its first unwatched episode, or from an optional episode such as
115
+ `ep3`. For example: `play Nisekoi ep3`.
116
+ * `play [episode]` (or `p`) — from an episode-selection menu, play the current
117
+ anime from its first unwatched episode, or from the specified episode.
118
+ * `rename <anime>` — from the anime-selection menu, rename the named series'
119
+ episode files into the application naming structure.
120
+ * `rename [anime]` — from an episode-selection menu, rename the current series'
121
+ files, or a named series elsewhere in the collection.
122
+ * `add <directory>` — from the anime-selection menu, move a series directory
123
+ into the collection; quote the path when it contains spaces.
124
+ The **Add series** menu button opens a directory picker for the same action.
125
+ * `move <anime> [destination]` — from the anime-selection menu, move a named
126
+ series out of the collection. When no destination is given, it moves to the
127
+ current user's home directory.
128
+ * `quit` (or `q`) — exit `anime-cli` from the anime-selection menu, or return
129
+ to that menu from an episode-selection menu.
130
+
131
+ ### Open an anime directly
132
+
133
+ ```bash
134
+ anime "anime name"
135
+ ```
136
+
137
+ For example:
138
+
139
+ ```bash
140
+ anime nisekoi
141
+ ```
142
+
143
+ ### Play an episode
144
+
145
+ An episode can be selected through the anime menu or specified after the anime name:
146
+
147
+ ```bash
148
+ anime nisekoi ep1
149
+ ```
150
+
151
+ ### Add a series directory
152
+
153
+ Move a series directory into the configured anime collection:
154
+
155
+ ```bash
156
+ anime --add /path/to/Nisekoi
157
+ ```
158
+
159
+ The source directory is moved rather than copied. The command will not overwrite
160
+ an existing series with the same directory name.
161
+
162
+ ### Move a series out of the collection
163
+
164
+ Move a configured series to a destination directory:
165
+
166
+ ```bash
167
+ anime --move "Nisekoi" /path/to/destination
168
+ ```
169
+
170
+ When the destination is omitted, the series is moved to your home directory. On
171
+ Windows, this uses the current user's home folder and accepts standard Windows
172
+ paths:
173
+
174
+ ```powershell
175
+ anime --move "Nisekoi" "C:\Users\Jeff\Videos"
176
+ ```
177
+
178
+ ## Directory Structure
179
+
180
+ `anime-cli` expects your anime collection to be organized approximately like this:
181
+
182
+ ```text
183
+ anime/
184
+ ├── Nisekoi/
185
+ │ ├── ep1-...
186
+ │ ├── ep2-...
187
+ │ └── ep3-...
188
+
189
+ ├── Naruto/
190
+ │ ├── ep1-...
191
+ │ ├── ep2-...
192
+ │ └── ep3-...
193
+
194
+ └── One Piece/
195
+ ├── ep1-...
196
+ ├── ep2-...
197
+ └── ep3-...
198
+ ```
199
+
200
+ The configured directory should contain the **series folders**, rather than being a single series folder.
201
+
202
+ ## Renaming Episodes
203
+
204
+ If your episodes aren't using the naming structure expected by `anime-cli`, use:
205
+
206
+ ```bash
207
+ anime --rename
208
+ ```
209
+
210
+ This opens a menu allowing you to:
211
+
212
+ 1. Enter a directory path.
213
+ 2. Select a directory using a file explorer.
214
+ 3. Exit.
215
+
216
+ You can also provide the directory directly:
217
+
218
+ ```bash
219
+ anime --rename /path/to/anime
220
+ ```
221
+
222
+ For example:
223
+
224
+ ```bash
225
+ anime --rename ~/Downloads/Nisekoi
226
+ ```
227
+
228
+ The renamer converts the files into the episode naming scheme used by the application.
229
+
230
+ > Make sure you have a backup if the directory contains files you don't want renamed.
231
+
232
+ ## Configuration
233
+
234
+ Application configuration is stored in the user's configuration directory rather than inside the project.
235
+
236
+ The application creates its configuration directory automatically when needed.
237
+
238
+ The configured anime directory is stored in a structure similar to:
239
+
240
+ ```json
241
+ {
242
+ "anime_list": "/path/to/your/anime"
243
+ }
244
+ ```
245
+
246
+ Personal configuration files should not be committed to the project repository.
247
+
248
+ ## MyAnimeList API
249
+
250
+ MAL requests are **not made directly by the installed CLI**.
251
+
252
+ The architecture is:
253
+
254
+ ```text
255
+ anime-cli
256
+
257
+ │ HTTPS
258
+
259
+ Hosted anime-cli API
260
+
261
+ │ X-MAL-CLIENT-ID
262
+
263
+ MyAnimeList API
264
+ ```
265
+
266
+ The MAL client ID exists only on the hosted server. It is supplied through the
267
+ server's `MAL_CLIENT_ID` environment variable and is never included in the CLI
268
+ package.
269
+
270
+ Users therefore do **not** need to create a MyAnimeList developer application,
271
+ configure a MAL client ID, or keep an API credential on their computer.
272
+
273
+ ### Running the API server locally
274
+
275
+ The API can also be run locally for development. From the repository root:
276
+
277
+ ```bash
278
+ export MAL_CLIENT_ID="your_client_id"
279
+ uvicorn server.main:app --reload
280
+ ```
281
+
282
+ Then point the CLI at the local server:
283
+
284
+ ```bash
285
+ export ANIME_API_URL="http://127.0.0.1:8000"
286
+ anime
287
+ ```
288
+
289
+ The production client defaults to the hosted API URL. `ANIME_API_URL` is only
290
+ needed when overriding it, such as for local development or testing.
291
+
292
+ ### Deploying the server
293
+
294
+ The repository contains a `server/Dockerfile` and `render.yaml` for deployment.
295
+ A Render deployment can use the repository's `render.yaml` configuration.
296
+
297
+ Set the following secret in the hosting provider:
298
+
299
+ ```text
300
+ MAL_CLIENT_ID=your_mal_client_id
301
+ ```
302
+
303
+ Do **not** put the actual client ID in `render.yaml`, Dockerfiles, source code,
304
+ or Git.
305
+
306
+ The server exposes only the operations needed by the CLI:
307
+
308
+ ```text
309
+ GET /anime/search?q=<name>
310
+ GET /anime/<id>
311
+ ```
312
+
313
+ The server also keeps the existing SQLite API cache, so repeated MAL requests
314
+ can be served without contacting MAL every time.
315
+
316
+ ## Cache
317
+
318
+ `anime-cli` maintains a local cache for application data, while the hosted API
319
+ maintains its own cache for MAL responses.
320
+
321
+ Runtime cache databases should not be committed to the repository.
322
+
323
+ For example, a Git repository should ignore:
324
+
325
+ ```gitignore
326
+ *.db
327
+ ```
328
+
329
+ ## Updating
330
+
331
+ If `anime-cli` was installed with `pipx`, update it with:
332
+
333
+ ```bash
334
+ pipx upgrade anime-cli
335
+ ```
336
+
337
+ If a new release is available on PyPI, `pipx` will install the updated version.
338
+
339
+ ## Uninstalling
340
+
341
+ To remove `anime-cli`:
342
+
343
+ ```bash
344
+ pipx uninstall anime-cli
345
+ ```
346
+
347
+ ## Development
348
+
349
+ Clone the repository:
350
+
351
+ ```bash
352
+ git clone https://github.com/jeff841/anime-cli
353
+ cd anime-cli
354
+ ```
355
+
356
+ Create a development virtual environment:
357
+
358
+ ```bash
359
+ python -m venv .venv
360
+ source .venv/bin/activate
361
+ ```
362
+
363
+ Install the project in editable mode:
364
+
365
+ ```bash
366
+ pip install -e .
367
+ ```
368
+
369
+ This allows changes to the source code to be tested without rebuilding the package after every change.
370
+
371
+ ## Building
372
+
373
+ Install the Python build frontend:
374
+
375
+ ```bash
376
+ python -m pip install build
377
+ ```
378
+
379
+ Build the package:
380
+
381
+ ```bash
382
+ python -m build
383
+ ```
384
+
385
+ This creates the distribution files in `dist/`:
386
+
387
+ ```text
388
+ dist/
389
+ ├── anime_cli-0.1.0-py3-none-any.whl
390
+ └── anime_cli-0.1.0.tar.gz
391
+ ```
392
+
393
+ ### Test the built wheel with pipx
394
+
395
+ You can test the exact wheel that will be distributed:
396
+
397
+ ```bash
398
+ pipx install ./dist/anime_cli-0.1.0-py3-none-any.whl
399
+ ```
400
+
401
+ Then test the application from outside the repository:
402
+
403
+ ```bash
404
+ cd ~
405
+ anime --help
406
+ ```
407
+
408
+ This verifies that the installed package works independently of the source directory.
409
+
410
+ If the package is already installed, reinstall the newly built wheel:
411
+
412
+ ```bash
413
+ pipx reinstall ./dist/anime_cli-0.1.0-py3-none-any.whl
414
+ ```
415
+
416
+ ## Git
417
+
418
+ Generated files and local configuration should not be committed.
419
+
420
+ A suitable `.gitignore` includes:
421
+
422
+ ```gitignore
423
+ .venv/
424
+ __pycache__/
425
+ *.py[cod]
426
+ build/
427
+ dist/
428
+ *.egg-info/
429
+ *.db
430
+ .env
431
+ ```
432
+
433
+ Source code, `pyproject.toml`, documentation, and other files required to build and distribute the application should be committed.
434
+
435
+ ## Project Structure
436
+
437
+ ```text
438
+ anime-cli/
439
+ ├── anime/
440
+ │ ├── __init__.py
441
+ │ ├── __main__.py
442
+ │ ├── remote_api.py
443
+ │ ├── cli.py
444
+ │ ├── episode.py
445
+ │ ├── extra.py
446
+ │ ├── kitty.py
447
+ │ ├── main.py
448
+ │ ├── picture.py
449
+ │ ├── play.py
450
+ │ ├── renamer.py
451
+ │ ├── reset_watched.py
452
+ │ └── watch_input.py
453
+ ├── server/
454
+ │ ├── __init__.py
455
+ │ ├── config.py
456
+ │ ├── main.py
457
+ │ ├── mal.py
458
+ │ ├── Dockerfile
459
+ │ └── requirements.txt
460
+ ├── render.yaml
461
+ ├── README.md
462
+ ├── pyproject.toml
463
+ └── .gitignore
464
+ ```
465
+
466
+ ## License
467
+
468
+ Add your chosen license here before publishing the project.
469
+
470
+ ## Status
471
+
472
+ `anime-cli` is currently in early development.
473
+
474
+ The `0.1.0` release is an initial release while the application's interface and features continue to mature.