Git Product home page Git Product logo

pycbzhelper's Introduction

PyCBZHelper

License Release Latest Version

PyCBZHelper is a Python library for creating CBZ (Comic Book Zip) files with metadata. It provides functionality to generate a CBZ file from a list of image pages and associated comic book metadata.

Features

  • Create CBZ files from images.
  • Generate ComicInfo.xml metadata.
  • Support for various metadata fields.
  • Handle page files from local disk or web URLs.
  • Automatic cleanup of temporary files.

Installation

You can install PyCBZHelper using pip:

pip install pycbzhelper

Usage

Here's a basic example of how to use PyCBZHelper:

from pycbzhelper import Helper
from pathlib import Path

PARENT = Path(__name__).resolve().parent

if __name__ == "__main__":
    # Define metadata for the comic
    metadata = {
        "Title": "My Comic",
        "Series": "Comic Series",
        "Number": "1",
        "Pages": [
            {"File": PARENT / "image1.jpg"},
            {"File": PARENT / "image2.jpg"},
        ]
        # Add more metadata fields here
    }

    # Define the path to the output CBZ file
    output_path = PARENT / "output.cbz"

    # Create an instance of the Helper class
    helper = Helper(metadata)

    # Create the CBZ file
    helper.create_cbz(output_path)

For more information on how to use PyCBZHelper, please refer to the documentation.

Exceptions

The following exceptions can be raised by PyCBZHelper:

  • InvalidKeyValue: Raised when a key value is invalid.
  • MissingPageFile: Raised when no page files are available.
  • InvalidFileExtension: Raised when an invalid file extension is used.
  • FileNotFound: Raised when the specified source file is not found.

License

This project is licensed under the GPL v3 License.

pycbzhelper's People

Contributors

hyugogirubato avatar domenicoblanco avatar rivmt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.