# CBZ
[![License](https://img.shields.io/github/license/hyugogirubato/cbz)](https://github.com/hyugogirubato/cbz/blob/main/LICENSE)
[![Release](https://img.shields.io/github/release-date/hyugogirubato/cbz)](https://github.com/hyugogirubato/cbz/releases)
[![Latest Version](https://img.shields.io/pypi/v/cbz)](https://pypi.org/project/cbz/)
CBZ is a Python package designed to facilitate the creation, manipulation, and extraction of comic book archive files in the CBZ format. It allows users to programmatically generate CBZ files from a collection of images, add metadata to the archives, and unpack existing CBZ files. This library is ideal for comic book enthusiasts, archivists, and developers working on applications involving digital comic book distributions.
## Features
- **Create CBZ Files**: Pack a series of images into a CBZ file with ease.
- **Extract CBZ Files**: Unpack images and metadata from existing CBZ files.
- **Manage Metadata**: Add, update, and retrieve metadata from CBZ files, including titles, authors, volume numbers, and more.
- **Support for ComicInfo.xml**: Utilizes the ComicInfo.xml standard for embedding comic book metadata within CBZ files.
- **Flexible Image Handling**: Load images from various formats and ensure they are correctly formatted and ordered within the CBZ file.
- **High-Level API**: Offers a simple, high-level API for common tasks, while also providing access to lower-level functions for advanced usage.
## Installation
To install the CBZ library, you can use pip:
```bash
pip install cbz
```
## Quick Start
Here's a quick example of how to create a CBZ file from a series of images:
```python
from pathlib import Path
from cbz.page import PageInfo
from cbz.comic import ComicInfo
from cbz.constants import PageType, YesNo, Manga, AgeRating, Format
if __name__ == '__main__':
# Define the path to your images
images_path = Path('path/to/your/images')
# Load images and create page objects
pages = [PageInfo.load(path) for path in images_path.iterdir()]
# Create a ComicInfo object with your comic's metadata
comic = ComicInfo.from_pages(
pages=pages,
title='Your Comic Title',
series='Your Comic Series',
number='1',
language_iso='en',
format=Format.WEB_COMIC,
black_white=YesNo.NO,
manga=Manga.NO,
age_rating=AgeRating.PENDING
)
# Pack the comic into a CBZ file
cbz_content = comic.pack()
# Save the CBZ file
cbz_path = Path('your_comic.cbz')
cbz_path.write_bytes(cbz_content)
```
## Documentation
For detailed documentation, including the full API reference and more examples, please refer to the [official CBZ Library documentation](https://en.wikipedia.org/wiki/Comic_book_archive).
## License
The CBZ Library is released under the MIT License. See [LICENSE](LICENSE) for details.
## Acknowledgments
This library was developed with the needs of comic book fans and digital archivists in mind. We hope it helps you in managing and enjoying your comic book collections.
Raw data
{
"_id": null,
"home_page": "https://github.com/hyugogirubato/cbz",
"name": "cbz",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "metadata,manga,comics,ebooks,cbz,webtoons",
"author": "hyugogirubato",
"author_email": "hyugogirubato@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b0/2c/18dede474711b06cf974e55f212931168b8e3e747dc09cd4d6c0fb5243c0/cbz-3.2.0.tar.gz",
"platform": null,
"description": "# CBZ\r\n\r\n[![License](https://img.shields.io/github/license/hyugogirubato/cbz)](https://github.com/hyugogirubato/cbz/blob/main/LICENSE)\r\n[![Release](https://img.shields.io/github/release-date/hyugogirubato/cbz)](https://github.com/hyugogirubato/cbz/releases)\r\n[![Latest Version](https://img.shields.io/pypi/v/cbz)](https://pypi.org/project/cbz/)\r\n\r\nCBZ is a Python package designed to facilitate the creation, manipulation, and extraction of comic book archive files in the CBZ format. It allows users to programmatically generate CBZ files from a collection of images, add metadata to the archives, and unpack existing CBZ files. This library is ideal for comic book enthusiasts, archivists, and developers working on applications involving digital comic book distributions.\r\n\r\n## Features\r\n\r\n- **Create CBZ Files**: Pack a series of images into a CBZ file with ease.\r\n- **Extract CBZ Files**: Unpack images and metadata from existing CBZ files.\r\n- **Manage Metadata**: Add, update, and retrieve metadata from CBZ files, including titles, authors, volume numbers, and more.\r\n- **Support for ComicInfo.xml**: Utilizes the ComicInfo.xml standard for embedding comic book metadata within CBZ files.\r\n- **Flexible Image Handling**: Load images from various formats and ensure they are correctly formatted and ordered within the CBZ file.\r\n- **High-Level API**: Offers a simple, high-level API for common tasks, while also providing access to lower-level functions for advanced usage.\r\n\r\n## Installation\r\n\r\nTo install the CBZ library, you can use pip:\r\n\r\n```bash\r\npip install cbz\r\n```\r\n\r\n## Quick Start\r\n\r\nHere's a quick example of how to create a CBZ file from a series of images:\r\n\r\n```python\r\nfrom pathlib import Path\r\nfrom cbz.page import PageInfo\r\nfrom cbz.comic import ComicInfo\r\nfrom cbz.constants import PageType, YesNo, Manga, AgeRating, Format\r\n\r\nif __name__ == '__main__':\r\n # Define the path to your images\r\n images_path = Path('path/to/your/images')\r\n\r\n # Load images and create page objects\r\n pages = [PageInfo.load(path) for path in images_path.iterdir()]\r\n\r\n # Create a ComicInfo object with your comic's metadata\r\n comic = ComicInfo.from_pages(\r\n pages=pages,\r\n title='Your Comic Title',\r\n series='Your Comic Series',\r\n number='1',\r\n language_iso='en',\r\n format=Format.WEB_COMIC,\r\n black_white=YesNo.NO,\r\n manga=Manga.NO,\r\n age_rating=AgeRating.PENDING\r\n )\r\n\r\n # Pack the comic into a CBZ file\r\n cbz_content = comic.pack()\r\n\r\n # Save the CBZ file\r\n cbz_path = Path('your_comic.cbz')\r\n cbz_path.write_bytes(cbz_content)\r\n```\r\n\r\n## Documentation\r\n\r\nFor detailed documentation, including the full API reference and more examples, please refer to the [official CBZ Library documentation](https://en.wikipedia.org/wiki/Comic_book_archive).\r\n\r\n## License\r\n\r\nThe CBZ Library is released under the MIT License. See [LICENSE](LICENSE) for details.\r\n\r\n## Acknowledgments\r\n\r\nThis library was developed with the needs of comic book fans and digital archivists in mind. We hope it helps you in managing and enjoying your comic book collections.\r\n",
"bugtrack_url": null,
"license": "GPL-3.0-only",
"summary": "CBZ is a Python package designed to facilitate the creation, manipulation, and extraction of comic book archive files in the CBZ format.",
"version": "3.2.0",
"project_urls": {
"Homepage": "https://github.com/hyugogirubato/cbz"
},
"split_keywords": [
"metadata",
"manga",
"comics",
"ebooks",
"cbz",
"webtoons"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b02c18dede474711b06cf974e55f212931168b8e3e747dc09cd4d6c0fb5243c0",
"md5": "f4f45f6e5406acf9a0b827fd0c12d6da",
"sha256": "f115c65b0ecf04ddb8b1da2686ab2c767f800efdb610869b5d95b3031d71ed92"
},
"downloads": -1,
"filename": "cbz-3.2.0.tar.gz",
"has_sig": false,
"md5_digest": "f4f45f6e5406acf9a0b827fd0c12d6da",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 18113,
"upload_time": "2024-03-17T13:50:58",
"upload_time_iso_8601": "2024-03-17T13:50:58.297948Z",
"url": "https://files.pythonhosted.org/packages/b0/2c/18dede474711b06cf974e55f212931168b8e3e747dc09cd4d6c0fb5243c0/cbz-3.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-17 13:50:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hyugogirubato",
"github_project": "cbz",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "cbz"
}