PYPI PACKAGE AUDIT v5.7.1 Healthy Package

comicbox

Comic book archive multi format metadata read/write/transform tool and image extractor.

PyPkgScore comicbox
Methodology & Criteria โ™ฅ Donate
720 / 1000
Quick Install
pip install comicbox
1. Governance
50/200
2. PEP Metadata
200/200
3. Security
150/200
4. Docs & SEO
155/200
5. CI Engineering
165/200
๐Ÿ“ฃ Share Audit: Share this report and visual preview in the current language
Advertisement
PYPI TELEMETRY

Downloads & Community Adoption

Last 30 days (without mirrors)
Last 7 days
940
Last 30 days
4093
Total (180 days)
32228
Metric / Ecosystem Status / Value Source
Downloads (30d / 180d) โ€” PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) โœ• Not detected PyPI Integrity / Sigstore
Django Packages โ€” djangopackages.org
PyTech / PyPkgScore 720 / 1000 PyPkgScore Engine

Health & Engineering Analysis (5 Pillars)

1. Governance & Community50 / 200 โ–พ
LICENSEโœ“ 50 pts
SECURITY.mdโœ• 0 pts
CONTRIBUTING.mdโœ• 0 pts
CODE_OF_CONDUCT.mdโœ• 0 pts
2. PEP Metadata & Packaging200 / 200 โ–พ
Wheel (.whl)โœ“ 50 pts
pyproject.tomlโœ“ 50 pts
Project URLsโœ“ 50 pts
Trove Classifiersโœ“ 50 pts
3. Security & Supply Chain150 / 200 โ–พ
Zero CVEs (OSV)โœ“ 60 pts
Trusted Publishing (OIDC)โœ• 0 pts
Snyk / Audit Linkโœ“ 40 pts
HTTPS Repositoryโœ“ 50 pts
4. Documentation, SEO & Ecosystem155 / 200 โ–พ
Structured READMEโœ“ 60 pts
Read the Docsโœ“ 50 pts
Django Packagesโœ• 0 pts
Website / Technical Articlesโœ“ 45 pts
5. Engineering, CI & Quality165 / 200 โ–พ
Automated Testsโœ“ 65 pts
GitHub Actions CIโœ“ 65 pts
CHANGELOG.mdโœ• 0 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)โœ“ 35 pts
Advertisement
README & DOCS

Official Documentation & Usage Guide โ€” comicbox

PyPI Metadata v5.7.1
Show full original documentation (English README) โ–พ

Comicbox

PyPI Python License Docs

Comicbox is a Python library and command line tool that reads, writes, and synthesizes comic book archive metadata. It understands every popular comic metadata standard, merges them into one consistent data model, converts between them, tags comics from online databases, and extracts pages and covers.

It is the metadata engine behind the Codex comic reader, but works just as well as a standalone command line tool for organizing a comic library.

โœจ What Comicbox Does

  • Reads many archive types โ€” CBZ, CBR, CBT, CB7, and (optionally) PDF.
  • Reads and writes every popular metadata standard โ€” ComicInfo.xml, MetronInfo.xml, ComicBookInfo, CoMet, PDF metadata, and its own YAML/JSON.
  • Merges every source into one model โ€” combines metadata from each embedded format and the filename into a single normalized view, then writes it back out to whichever formats you choose.
  • Tags comics online โ€” looks up and matches comics against Metron, ComicVine and VerseDB, then writes the result.
  • Converts archives โ€” repacks CBR/CBT/CB7 (and comic PDFs) to CBZ, and translates metadata between formats.
  • Extracts images โ€” pulls cover art or arbitrary page ranges out of any supported archive.
  • Works with reading lists โ€” reads, converts and combines ComicRack CBL, json-cbl and its own lists, fetches them from Metron, Comic Vine and the DieselTech catalog, and tags your comics with a list's story arc.
  • Is scriptable and embeddable โ€” a rich CLI, a Python API, and published schemas for every format.

๐Ÿ“š Archive Formats

Format Read Write
CBZ (zip) โœ… โœ…
CBR (rar) โœ… converts to CBZ
CBT (tar) โœ… converts to CBZ
CB7 (7z) โœ… converts to CBZ
PDF โœ… โœ… embedded metadata

CBR extraction and conversion require RARLAB's unrar binary on your PATH. PDF support is an optional extra: pip install comicbox[pdf].

๐Ÿท๏ธ Metadata Formats

Comicbox reads and writes all of the following, normalizing each into a common schema:

Format Read Write Notes
ComicInfo.xml (ComicRack) โœ… โœ… v2.1 (draft) schema
MetronInfo.xml โœ… โœ… v1.3 (draft) schema
ComicBookInfo (Comic Book Lover) โœ… โœ… archive comment JSON
CoMet โœ… โœ…
PDF metadata โœ… โœ… can embed ComicInfo.xml / MetronInfo.xml
Comicbox YAML / JSON โœ… โœ… native, lossless
Filename โœ… โ€” parses metadata out of the file name

A full cross-format tag translation table is available.

๐Ÿ”€ One Unified Metadata Model

Different formats spell the same idea in different ways. Comicbox reconciles them so you never have to:

  • Identifiers โ€” database IDs and GTINs from every format are aggregated into a single identifiers structure, and written back out as URNs in the Notes field. Web links live beside them in their own urls list, kept as the file wrote them. Comicbox fills in a missing url from an identifier and a missing identifier from a url it recognizes, so you get both.
  • Reprints โ€” Alternate Names, Aliases, and "is version of" relationships collapse into one reprints list.
  • Notes mining โ€” the heavily-abused Notes field is parsed for embedded data (tagger, timestamps, identifiers, and web links) that formats don't otherwise carry.
  • Liberal value parsing โ€” fuzzy, caseless values for enum-like fields (Age Rating, Format, credit roles) are accepted, tidied to Title Case, and converted to each output format's own enum on write.
  • Filename parsing โ€” series, issue, year, and more are extracted from a wide variety of naming conventions via comicfn2dict.

๐ŸŒ Online Tagging

Comicbox can identify a comic and tag it from an online database. Metron, ComicVine and VerseDB are supported. It searches by the series, issue, and year it knows about, ranks candidates, breaks close calls with cover-image matching, and writes the best result. Metron is asked by the comic's cover first, and a cover that clearly matches one issue is written without the name search.

# Interactive: prompts only when the match isn't clear.
comicbox -o metron "GI Joe #007 (1952).cbz"

# Tag by an exact database id (skips searching).
comicbox -I metron:42 "comic.cbz"

# Unattended batch run: never prompts, 4 files at a time.
comicbox --online all --recurse --prompts never -j 4 ./comics/

--match controls how confidently comicbox writes without asking (ask ยท careful ยท auto ยท eager), and --effort (minimal ยท balanced ยท thorough) trades matching accuracy for fewer API calls on fan-out sources like ComicVine โ€” Metron and VerseDB don't fan out, so they ignore effort and always search at full strength. Credentials come from --auth, COMICBOX_* environment variables, or the config file. Metron authenticates with an API token generated on your metron.cloud account page โ€” pass it as --auth metron:TOKEN or COMICBOX_ONLINE__AUTH__METRON__KEY. ComicVine takes its key the same way, as --auth comicvine:KEY. See comicbox -h for the full set of online, caching, and tuning options.

VerseDB

VerseDB is a community comics and manga database. Without a token comicbox never asks it. It runs after Metron and ComicVine unless --online lists it earlier, and with --all-sources the first source listed wins where they disagree.

  • Token: create a free account, then a personal access token at versedb.com/my/apps/custom/create. Pass it as --auth versedb:TOKEN or COMICBOX_ONLINE__AUTH__VERSEDB__KEY.
  • Limits: the free tier allows 300 requests an hour and 4,000 a day. A comic costs about three, fewer when a run tags several issues of one series. Answers are cached for online.cache.ttl (7 days by default), so tagging a comic again within that spends none. When VerseDB says to slow down, comicbox waits as long as it asks.
  • Terms: VerseDB's free API is for non-commercial use, and its terms ask for a linked credit wherever its data is shown. Comicbox prints "Data from VerseDB" with a link under VerseDB's candidates when it prompts, and writes each issue's versedb.com link into the tags.
comicbox -o versedb "Absolute Bladehawk #024 (2026).cbz"
comicbox -I versedb:1215061 "comic.cbz"

Data from VerseDB.

๐Ÿ–ผ๏ธ Pages, Covers & Conversion

# Extract the cover image.
comicbox -X --dest-path ./out "comic.cbz"

# Extract a range of pages (zero-based) by index.
comicbox -x 0:5 --dest-path ./out "comic.cbz"

# Convert a CBR to a CBZ, carrying metadata across.
comicbox -z "comic.cbr"

# Convert a single-image-per-page comic PDF to CBZ without re-encoding.
comicbox --cbz --pdf-pages image "comic.pdf"

# Rename a file to comicbox's canonical filename format.
comicbox --rename "comic.cbz"

๐Ÿ“ฆ Installation

pip install comicbox

For PDF support, install the pdf extra:

pip install comicbox[pdf]

Dependencies

Comicbox needs no binary dependencies for CBZ, CBT, and CB7. Reading or converting CBR archives requires RARLAB's unrar binary on your PATH (brew install rar on macOS, unrar from Debian's non-free). rarfile falls back to bsdtar and 7-Zip, but through rarfile 4.5 bsdtar can't extract RAR at all, and 7-Zip builds without the RAR codec can't either. comicbox doctor says whether this host can read CBRs.

The optional PDF extra pulls in pymupdf-lite, PyMuPDF without its layout-analysis engine. It ships wheels with a bundled libmupdf for glibc Linux on x86_64 and aarch64, musl Linux on x86_64, macOS, and Windows. Anywhere else pip compiles it, which needs a C/C++ toolchain; see the PyMuPDF installation docs.

[!WARNING]

pymupdf and pymupdf-lite install the same files, so never install both. A pip upgrade from a comicbox that used pymupdf leaves it behind. Remove it and reinstall pymupdf-lite:

pip uninstall -y pymupdf
pip install --force-reinstall pymupdf-lite

To use the full pymupdf instead, see PDFFile's README.

โŒจ๏ธ Command Line

Comicbox ships a thorough, self-documenting CLI. Run:

comicbox -h

for the complete reference, including every metadata format key, the --print phases, and the online tagging tables. A few representative commands:

# Print the merged metadata comicbox reads from a comic.
comicbox -p "comic.cbz"

# Set a field and write it as ComicInfo.xml inside the archive. -w writes only
# the formats named and removes every other tag file.
comicbox -m "{publisher: SmallComics}" -w cix "comic.cbz"

# Set a field and write it back in every format the comic already has, or add
# ComicInfo.xml to them: keep removes nothing.
comicbox -m "{publisher: SmallComics}" -w keep "comic.cbz"
comicbox -m "{publisher: SmallComics}" -w cix,keep "comic.cbz"

# Recursively set a field across an entire library.
comicbox --recurse -m "{publisher: 'SC Comics'}" -w cix ./comics/

# Export and re-import metadata as a file.
comicbox -e cix "comic.cbz"
comicbox -i ComicInfo.xml -w cix "comic.cbz"

-m/--metadata accepts a compact "linear YAML" using tag names from any of the supported formats. Put a space after each colon so it parses as YAML, and quote values containing YAML special characters (:[]{},). See comicbox -h for many more -m examples, and "escaping YAML" for the escaping details.

[!TIP]

Preview before writing. Add -p to print exactly what would be written, or -n/--dry-run to perform an action without touching the filesystem.

Editing or Deleting Metadata

The cleanest way to edit or remove existing tags is to round-trip through a file:

# 1. Export the current metadata to an editable file.
comicbox --export cix "My Overtagged Comic.cbz"

# 2. Edit it.
nvim ComicInfo.xml

# 3. Preview the re-import.
comicbox --import ComicInfo.xml -p "My Overtagged Comic.cbz"

# 4. Wipe the old tags, then write the edited file back (careful!).
comicbox --delete-all-tags "My Overtagged Comic.cbz"
comicbox --import ComicInfo.xml -w cix "My Overtagged Comic.cbz"

You can also drop individual keys with -D/--delete-keys using dotted glom paths, e.g. -D series,reprints.0.series.

How Tags Are Written

  • A CBZ is re-tagged in place: only its trailing tag files, central directory and end record are rewritten, never its pages. A CBZ whose tag files come before its pages, as some other tools write them, is written once on a copy that then replaces it, every other member kept as it was and the tags moved last, and patched in place after that.
  • -w removes every tag file it does not name and a ComicBookInfo comment; a free-text archive comment, such as a scanner's note, stays unless -w cbi writes ComicBookInfo in its place. In a PDF, -w removes the embedded tag files it does not name, as in a zip, and rewrites the PDF's own metadata only for pdf or keep. --delete-all-tags clears all of these.
  • A write that fails while comicbox is running leaves the comic as it was.
  • A process killed in the middle of a re-tag can leave the tag files damaged; the pages are never touched.
  • A copy is written through a hidden temporary .<comic name>.comicbox.tmp, which replaces the comic keeping its mode, and its owner and group where they may be set. On Linux it keeps the comic's extended attributes too; on macOS they are not carried over, so a Finder tag on a comic written through a copy is lost. A leftover copy is removed by the next write. A directory that cannot hold the copy gets the in-place write, with a warning. A PDF is saved to a temporary file that replaces it, and a CBR, CBT or CB7 is converted through .<comic name>.comicbox.tmp too. Where a comic's name is too long for that name, a hash of it stands in.

Reading Lists

comicbox readinglist, or comicbox rl, reads, converts, combines and compares reading lists: ComicRack .cbl, json-cbl, and comicbox YAML and JSON. It fetches lists from Metron, Comic Vine story arcs, the DieselTech catalog and URLs, and tags the comics a list matches with its story arc.

comicbox rl print "Crimson Tide.cbl"
comicbox rl convert --to json-cbl "Crimson Tide.cbl"
comicbox rl combine -o crimson-tide.yaml cbro.cbl locg.cbl

# Find a list online and fetch it.
comicbox rl search metron crimson tide
comicbox rl fetch metron:123 -o crimson-tide.yaml

# See which of its issues a directory has, then tag them with its arc: a dry
# run until --apply.
comicbox rl match crimson-tide.yaml ~/Comics/Marvel
comicbox rl write-arcs --apply -w cix,keep crimson-tide.yaml ~/Comics/Marvel

See Reading Lists for the formats, the online sources, what combining and matching do, and the Python API.

๐Ÿ›  API

Comicbox is primarily a library. The Comicbox class in comicbox.box is the main read interface, and comicbox.write exposes a documented write API. Auto-generated API docs are published with the HTML docs.

from comicbox.box import Comicbox

with Comicbox("comic.cbz") as cb:
    metadata = cb.to_dict()  # merged, normalized metadata
    file_type = cb.get_file_type()  # "CBZ", "PDF", ...
    mtime = cb.get_metadata_mtime()  # last metadata modification time
    cover = cb.get_cover_page()  # cover image bytes

Writing is done through the public write_metadata (single file) and bulk_write (batched) helpers:

from comicbox.write import write_metadata

result = write_metadata(
    "comic.cbz",
    # The patch is the contents under the "comicbox" root tag. The
    # root-wrapped dict Comicbox.to_dict() returns is also accepted.
    {"publisher": {"name": "SmallComics"}, "genres": ["Science Fiction"]},
    formats=["COMIC_INFO"],  # MetadataFormats names; e.g. COMIC_INFO, METRON_INFO
)
print(result.written)

comicbox.predict.predict_write_destination reports where a write would land โ€” in place, or the CBZ an unwritable archive repacks to โ€” and whether that path is already taken, without opening the archive or reading any metadata:

from comicbox.predict import predict_write_destination

dest = predict_write_destination("comic.cbr")
print(dest.destination, dest.converts, dest.occupied)

Every operational error these APIs raise derives from comicbox.exceptions.ComicboxError โ€” ArchiveError, ArchiveWriteError, DestinationOccupiedError, UnwritableFormatError, ComicNotFoundError, ConfigurationError, MetadataError, ExportError, WriteValidationError, OnlineConfigurationError, OnlineLookupAbortedError, ReadingListError, and UnsupportedArchiveTypeError โ€” so consumers can except ComicboxError without swallowing unrelated programming errors.

โš™๏ธ Configuration

Comicbox is configured by command line arguments, environment variables, and an optional config file, in that order of precedence.

  • Defaults live in config_default.yaml, which also documents the nested config groups (general, read, write, print, convert, compute, online, and readinglists).

  • Config file โ€” point at one with -c PATH, or place it at ~/.config/comicbox/config.yaml.

  • Environment variables are prefixed with COMICBOX_, and name their config key with __ between levels. Every config key can be set this way:

    COMICBOX_GENERAL__RECURSE=true
    COMICBOX_ONLINE__AUTH__METRON__KEY=your-token
    COMICBOX_ONLINE__AUTH__VERSEDB__KEY=your-token
    COMICBOX_ONLINE__TUNING__AUTO_THRESHOLD=0.9
    

    Values are parsed as YAML scalars, so true, 0.9, and 24h get the types the config file would give them. A value that doesn't fit its key is an error rather than being silently ignored. A list-valued key takes a string the way its CLI option does: comma-separated for the formats and delete keys (COMICBOX_WRITE__FORMATS=cix,mi), whole for -m and -i values. The indexed form (COMICBOX_READ__FORMATS__0=cix) works for any list.

  • Log level is set with the LOGLEVEL environment variable:

LOGLEVEL=ERROR comicbox -p "comic.cbz"

๐Ÿฉบ Troubleshooting

comicbox doctor checks everything comicbox depends on outside its own code: the RAR tool, the PDF extra, the image codecs online cover matching needs, your config files and environment variables, your online credentials, and the Python packages comicbox pins. Each row says OK, WARN, OFF (optional and not set up), MISSING, WRONG VERSION, MISCONFIGURED or ERROR, with a one-line fix for anything that isn't OK.

comicbox doctor

# The config a run with -c would load.
comicbox doctor -c tagging.yaml

# Problems only. Exits non-zero if something comicbox needs is broken, so it
# works as a Docker or CI health check.
comicbox doctor -q

# Also verify each configured online source's credentials, with one API
# request per source.
comicbox doctor --online all

Credentials are reported by where they came from (--auth, an env var, or a config file), never by value, so the report is safe to paste into a bug report.

๐Ÿ“ฆ Related Packages

Installing comicbox also installs two small sibling libraries, each usable on its own:

  • comicfn2dict โ€” parses metadata out of comic filenames into Python dicts (also used by ComicTagger).
  • pdffile โ€” presents a ZipFile-like interface for PDF files (installed with the [pdf] extra).

๐Ÿ“œ Documentation

๐Ÿ›  Development

Comicbox is hosted on GitHub. Most development tasks are driven by the Makefile โ€” run make to see what's available.

The DEBUG_TRANSFORM environment variable prints verbose schema-transform information, useful when debugging format conversions.

๐Ÿ“„ License

Comicbox is licensed under the LGPL-3.0-only license.