Skip to main content

Metron-Tagger

PyPI version Python versions License Ruff

Quick Description

A command-line tool to tag comic archives with metadata from metron.cloud.

Installation

PyPi

Or install it yourself:

pipx install metron-tagger

There are optional dependencies which can be installed by specifying one or more of them in braces e.g. metron-tagger[7zip]

The optional dependencies are:

  • 7zip: Provides support for reading/writing to CB7 files.
  • pdf: Provides support for reading/writing to PDF files.
  • redis: Provides a Redis-backed rate limiter for the Metron API.

FAQ

How do I use the Redis rate limiter?

  • Install the redis extra (e.g. pipx install metron-tagger[redis]), and set redis_url and your Metron username (user) in the [metron] section of your settings.ini:

    [metron]
    user = your-metron-username
    redis_url = redis://localhost:6379/0
    

    The username is required even though you authenticate with an API token, since the shared rate limit is keyed by your Metron account rather than by token (each application usually has its own token). Every metron-tagger process using the same Metron username and Redis server will then share one rate limit, so running several at once won't exceed Metron's limits. If the username isn't set or Redis can't be reached, metron-tagger falls back to its local rate limiter. If Redis fails partway through a run, metron-tagger stops processing the remaining files.

How do I share the rate limit with other mokkari-based software?

  • Other software using mokkari's RedisRateLimiter will share metron-tagger's rate limit as long as it uses the same Redis server and database, mokkari's default key_prefix (mokkari:ratelimit), and your Metron username as the account name. For example:

    from mokkari.redis_rate_limit import RedisRateLimiter
    
    rate_limiter = RedisRateLimiter(redis_client, metron_username)
    

What comics formats are supported?

  • Metron-Tagger supports CBZ, CBR, CBT, CB7 (optional), and PDF (optional) comics.

How to enable RAR support?

  • It depends on the unrar command-line utility, and expects it to be in your $PATH.

    NOTE: unrar only supports reading archives, so you will need to convert the archive to a cbz to write to it. To do so you can use -z, --export-to-cbz and if you want you can remove the orginal .cbr archive with --delete-original after successful conversion.

Help

usage: metron-tagger [-h] [-r] [-o] [-m] [-c] [--id ID] [-d] [--ignore-existing] [--accept-only] [--skip-multiple] [--ignore-modified] [--missing] [-s] [-z] [--validate] [--remove-non-valid] [--delete-original] [--duplicates] [--migrate] [--version]
                   path [path ...]

Read in a file or set of files, and return the result.

positional arguments:
  path                 Path of a file or a folder of files.

options:
  -h, --help           show this help message and exit
  -r, --rename         Rename comic archive from the files metadata. (default: False)
  -o, --online         Search online and attempt to identify comic archive. (default: False)
  -m, --metroninfo     Write, delete, or validate MetronInfo.xml. (default: False)
  -c, --comicinfo      Write, delete, or validate ComicInfo.xml. (default: False)
  --id ID              Identify file for tagging with the Metron Issue Id, or restrict directory matches to issues from a specific Metron Series Id. (default: None)
  -d, --delete         Delete the metadata tags from the file. (default: False)
  --ignore-existing    Ignore files that have existing metadata tag. (default: False)
  --accept-only        Automatically accept the match when exactly one valid match is found. (default: False)
  --skip-multiple      Skip files that have multiple matches instead of prompting for selection. (default: False)
  --ignore-modified    Retag files with an existing Metron ID without using the last modified date, forcing a full refresh from the API. Useful for pulling in changes, such as an updated community rating, that don't update the issue's modified date. (default: False)
  --missing            List files without metadata. (default: False)
  -s, --sort           Sort files that contain metadata tags. (default: False)
  -z, --export-to-cbz  Export a CBR (rar) archive to a CBZ (zip) archive. (default: False)
  --validate           Verify that comic archive has a valid metadata xml. (default: False)
  --remove-non-valid   Remove metadata xml from comic if not valid. Used with --validate option (default: False)
  --delete-original    Delete the original archive after successful export to another format. (default: False)
  --duplicates         Identify and give the option to delete duplicate pages in a directory of comics. (Experimental) (default: False)
  --migrate            Migrate information from a ComicInfo.xml into a *new* MetronInfo.xml (default: False)
  --version            Show the version number and exit

Examples

To tag all comics in a directory with MetronInfo.xml that don't already have one:

metron-tagger -om --ignore-existing /path/to/comics

To remove any ComicInfo.xml from a directory of comics:

metron-tagger -dc /path/to/comics

To validate any metadata, ComicInfo.xml and MetronInfo.xml, would be done by running the following:

metron-tagger -cm --validate /path/to/comics

To write MetronInfo.xml metadata from comics with ComicInfo.xml data, and migrate data for comics that don't exist at the Metron Comic Database:

metron-tagger -om --migrate /path/to/comics

To remove duplicate pages from comics (which should be only ran on a directory of weekly release since we scan all the pages within a comic), would be done by running the following:

metron-tagger --duplicates /path/to/weekly/comics

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features.

License

This project is licensed under the GPLv3 License.

Metadata

Release files for metron-tagger 5.1.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 metron-tagger 5.1.0
File Size Uploaded Provenance Actions
metron_tagger-5.1.0.tar.gz 80.2 kB Without provenance Details for metron_tagger-5.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for metron-tagger 5.1.0
File Interpreter ABI Platform Actions
metron_tagger-5.1.0-py3-none-any.whl Python 3 none any Details for metron_tagger-5.1.0-py3-none-any.whl

Total release size: 137.3 kB

Release files / metron_tagger-5.1.0.tar.gz

Download URL metron_tagger-5.1.0.tar.gz
Size 80.2 kB
Tags Source
SHA-256 checksum
How to use checksums
46a6077a8cbbdb9e0b8cfff92093bd22612a88a07509215abf2c7f801e43d05e
BLAKE2b-256 checksum
How to use checksums
c343f13647173c5edfc7c85033eb8d7a6f6eb83c68bb72f1acf9a645018d53e3
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":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / metron_tagger-5.1.0-py3-none-any.whl

Download URL metron_tagger-5.1.0-py3-none-any.whl
Size 57.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d25371bee6213d559e604763dee8011afed38a7a7f912b4c1ae70cc2254f4f10
BLAKE2b-256 checksum
How to use checksums
80f33a4d3056b28674bc23f45fc11c84fb7079f66dfa5a44d0b4a9552f34f383
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":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for metron-tagger 5.1.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.

Release history Release notifications | RSS feed

This release

5.1.0 This release

2 release files No provenance

1.2.5

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