https://github.com/metron-project/darkseid
Python library to interact with comic archives
https://github.com/metron-project/darkseid
comicbook comicinfo comics metadata tagging
Last synced: 10 months ago
JSON representation
Python library to interact with comic archives
- Host: GitHub
- URL: https://github.com/metron-project/darkseid
- Owner: Metron-Project
- License: gpl-3.0
- Created: 2019-11-12T20:19:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-14T20:54:13.000Z (over 1 year ago)
- Last Synced: 2024-11-14T21:34:23.325Z (over 1 year ago)
- Topics: comicbook, comicinfo, comics, metadata, tagging
- Language: Python
- Homepage:
- Size: 21.3 MB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Darkseid
[](https://pypi.org/project/darkseid/)
[](https://pypi.org/project/darkseid/)
[](https://github.com/charliermarsh/ruff)
[](https://github.com/pre-commit/pre-commit)
A [Python](https://www.python.org/) library to interact with comic archives.
## Installation
```bash
pip install darkseid
```
There are optional dependencies which can be installed by specifying one or more
of them in braces e.g. darkseid[7zip]
The optional dependencies are:
- **7zip**: Provides support for reading/writing to CB7 files.
- **pillow**: Provides support for getting page information that is used with
ComicInfo.xml metadata.
## Example
```python
from pathlib import Path
from darkseid.comic import Comic, MetadataFormat
comic = Comic(Path("my_comic.cbz"))
# Check if it's a valid comic
if comic.is_valid_comic():
print(f"Comic '{comic.name}' has {comic.get_number_of_pages()} pages")
# Read metadata
if comic.has_metadata(MetadataFormat.COMIC_INFO):
metadata = comic.read_metadata(MetadataFormat.COMIC_INFO)
print(f"Series: {metadata.series.name}")
# Get a page
page_data = comic.get_page(0) # First page
if page_data:
with open("cover.jpg", "wb") as f:
f.write(page_data)
```
## Documentation
[Read the project documentation](https://darkseid.readthedocs.io/en/stable/?badge=latest)
## Bugs/Requests
Please use the
[GitHub issue tracker](https://github.com/Metron-Project/darkseid/issues) to
submit bugs or request features.