Skip to main content

A set of utilities both library and cli to deal with CBZ files

Project description

This project is licensed under the GNU Lesser General Public License version 3.0 (LGPL-3.0). See LICENSE.txt for the full license text. Also check out licenses of vendored items inside the licenses folder.

CBZ Utilities

This is both a library and a command line tool to deal with CBZ files. It can perform different functions in relation to it. Its mostly a hobby project that was born out of need.

Features

  • Merging CBZ files
  • Auto generating a basic cover
  • Automatic Logical Ordering of input files

Install

To install the latest stable release, simply run the following

pip install cbzutils

or if you have pipx

pipx install cbzutils

then you can access it via the command line as cbzutils if its added to your PATH during install properly.

To clone and run this project

uv sync
uv tool install .

To provide contributions and install the project in editable mode

uv sync
uv tool install . -e

How to use

usage: cbzutils merge [-h] [-o FILE] [-s {default,namenum}] [-d] [--no-cover] [-t TITLE] [-T SUBTITLE] files [files ...]

positional arguments:
  files                 Path to all cbz files

options:
  -h, --help            show this help message and exit
  -o, --out FILE        Output file
  -s, --sort-key {default,namenum}
                        Sort key to sort names, by default uses a smart name num sort
  -d, --dry-run         Doesn't actually does the compression and instead prints the list of chapters in the order they shall be put according to the provided sort key
  --no-cover            Don't add automatically generated cover. Useful for chapters or volumes which already have a cover
  -t, --title TITLE     The title of the file for the cover, defaults to output file name
  -T, --subtitle SUBTITLE
                        The subtitle of the file for the cover, defaults to empty string

Here are a few examples. Suppose you have the following files in a folder

Chap 1.cbz
Chap 2.cbz
Chap 3.cbz
Chap 3.5.cbz
Chap 4.cbz

first cd into that folder

cd path/to/the/folder

and then you can run the following command

cbzutils merge Chap* -d

This will print a list of chapters and the order in which they shall be merged, be sure to check it. Please report any bugs to the github repository so the ordering can be fixed in special cases. But if the ordering is messed up, in the meanwhile, try renaming the files in a consistent manner like presented above. (Cbzutils itself is designed to work out of the box with all sorts of inconsistent file naming schemes).

Then to actually merge, run the following

cbzutils merge Chap* -o MyComic.cbz --title "MyComic" --subtitle "Ch 1-4"

This will produce an output cbz file named MyComic.cbz, you can now conver this file into other desired formats using Callibre, a free books management software.

Contribution Guidelines

  • Please format your code using black and isort before opening a PR.
  • All PRs introducing major changes should be accompanies by an Issue. Please discuss inside the Issue before going ahead and making changes.
  • Small changes regarding documentation and such can be made directly without an associated Issue

Thank you!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cbzutils-0.1.2.tar.gz (100.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cbzutils-0.1.2-py3-none-any.whl (89.3 kB view details)

Uploaded Python 3

File details

Details for the file cbzutils-0.1.2.tar.gz.

File metadata

  • Download URL: cbzutils-0.1.2.tar.gz
  • Upload date:
  • Size: 100.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cbzutils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e2bf9aee0409bddcf04c7e998d4ab7da6414d5d645a05a5fccbabb32de99e69b
MD5 3dbfaf7d2308da6f47507a24ae766c69
BLAKE2b-256 08a3787d94288abaf6badb7ce2beeee31c2ee6a06cafbf3e38ca0048141d9d51

See more details on using hashes here.

File details

Details for the file cbzutils-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cbzutils-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 89.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cbzutils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b496f0fac0b7507c1a0c096b15c8b4b42d1c2d05d10e1ab4150f866a11e11f76
MD5 57f4821fb55369fb477d404a27c3d897
BLAKE2b-256 f7afaf95daef7e3a90f955ab887997bf4f360cd832244346b29802f3286e51a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page