Skip to main content

Shortbox

PyPI - Python PyPI - Status PyPI - Version PyPI - License

prek Ruff ty

status-badge

An extensible library to manage comic archives and their embedded files and metadata.

Supported Formats

More can be added by extending the respective base class and adding to the registry.

Archives

Archive Extra Required
.cbz, .zip builtin
.cbt, .tar builtin
.cbr, .rar cbr
.cb7, .7z cb7
.pdf pdf

Compability Table

Format Read Update Create
cbz ✅ ✅ ✅
cbt ❌ ❌ ✅
cbr ✅ ❌ ❌
cb7 ✅ ❌ ✅
pdf ✅ ✅ ❌

If something is marked as in-compatible the library will try extracting and making the change via the local system and re-archive (if it has the create capability).

Metadata

Installation

pdm add shortbox

Optional extras can be added as needed:

pdm add shortbox[cbr,cb7,pdf]

Usage

from pathlib import Path

from shortbox import Comic
from shortbox.metadata import MetronInfo

my_comic = Path("MyComic.cbz")
with Comic.open(my_comic) as comic:
    print(comic.list_filenames())
    print(comic.read_file(filename="page-1.jpg").decode("UTF-8"))
    print(comic.metadata)  # Dict of registered metadata in archive

    metron_info = comic.get_metadata(metadata_type=MetronInfo)
    print(metron_info.series)

Writing files and metadata (support depends on the archive format, see table above):

with Comic.open(my_comic) as comic:
    comic.write_file(filename="page-99.jpg", data=b"...", override=True)
    comic.remove_file(filename="page-01.jpg")

    metron_info = comic.get_metadata(metadata_type=MetronInfo)
    metron_info.series.name = "Updated Title"
    comic.set_metadata(metron_info)

You can also convert between different archives (as long as the destination archive has create capability)

from shortbox.archives import ZipArchive

rar_comic = Path("MyComic.cbr")
with Comic.open(rar_comic) as comic:
    print(comic.file)  # MyComic.cbr
    comic.convert(
        ZipArchive, delete_original=True
    )  # All future comic interactions will be on the new archive
    print(comic.file)  # MyComic.cbz

Socials

Social - Matrix

Metadata

Release files for shortbox 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shortbox 0.6.0
File Size Uploaded Provenance Actions
shortbox-0.6.0.tar.gz 216.3 kB Without provenance Details for shortbox-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shortbox 0.6.0
File Interpreter ABI Platform Actions
shortbox-0.6.0-py3-none-any.whl Python 3 none any Details for shortbox-0.6.0-py3-none-any.whl

Total release size: 236.3 kB

Release files / shortbox-0.6.0.tar.gz

Download URL shortbox-0.6.0.tar.gz
Size 216.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5c5340ee00471ef2cf9edf03f6c08b3911fb6ac3944ae3750043d9948029e1f6
BLAKE2b-256 checksum
How to use checksums
9dd3d4e871a1ea1e073a37ff4a9433255c7f6a944d28f72ae5f0846fea37a4ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shortbox-0.6.0-py3-none-any.whl

Download URL shortbox-0.6.0-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c217a8c7e1ba4f0dae60463aec6abfb4e8b2afc12b9376094f0f37bd38599a51
BLAKE2b-256 checksum
How to use checksums
7b1bc6c51cd211621685358c8df34a50c11753c3f5099d6fc7e5643b86b93e4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for shortbox 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page