2024-01-15 12:08:39 -08:00
|
|
|
# comicfn2dict
|
2023-12-21 13:04:52 -08:00
|
|
|
|
2024-01-15 12:08:39 -08:00
|
|
|
An API and CLI for extracting structured comic metadata from filenames.
|
2023-12-21 13:04:52 -08:00
|
|
|
|
2024-01-15 12:08:39 -08:00
|
|
|
## Install
|
|
|
|
|
2024-02-16 18:27:29 -08:00
|
|
|
<!-- eslint-skip -->
|
|
|
|
|
2024-01-15 12:08:39 -08:00
|
|
|
```sh
|
|
|
|
pip install comicfn2dict
|
|
|
|
```
|
|
|
|
|
|
|
|
## API
|
|
|
|
|
2024-02-23 18:23:08 -08:00
|
|
|
<!-- eslint-skip -->
|
|
|
|
|
|
|
|
```python
|
|
|
|
from comicfn2dict import comicfn2dict, dict2comicfn
|
|
|
|
|
|
|
|
path = "Comic Series #001 Title (2024).cbz"
|
|
|
|
|
|
|
|
metadata: dict[str, str| tuple[str,...]] = comicfn2dict(path, verbose=0)
|
|
|
|
|
|
|
|
filename: str = dict2comicfn(metadata, bool=True, verbose=0)
|
|
|
|
```
|
2024-01-15 12:08:39 -08:00
|
|
|
|
|
|
|
## CLI
|
|
|
|
|
2024-02-16 18:27:29 -08:00
|
|
|
<!-- eslint-skip -->
|
|
|
|
|
2024-01-15 12:08:39 -08:00
|
|
|
```sh
|
|
|
|
comicfn2dict "Series Name #01 - Title (2023).cbz"
|
|
|
|
{'ext': 'cbz',
|
|
|
|
'issue': '001',
|
|
|
|
'series': 'Series Name',
|
|
|
|
'title': 'Title',
|
|
|
|
'year': '2023'}
|
|
|
|
```
|