Metron-Tagger
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
redisextra (e.g.pipx install metron-tagger[redis]), and setredis_urland your Metron username (user) in the[metron]section of yoursettings.ini:[metron] user = your-metron-username redis_url = redis://localhost:6379/0
The username is required even if 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
RedisRateLimiterwill share metron-tagger's rate limit as long as it uses the same Redis server and database, mokkari's defaultkey_prefix(mokkari:ratelimit), and your Metron username as theaccountname. 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-cbzand if you want you can remove the orginal .cbr archive with--delete-originalafter 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 4.17.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metron_tagger-4.17.1.tar.gz | 78.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metron_tagger-4.17.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 134.8 kB
Release files / metron_tagger-4.17.1.tar.gz
| Download URL | metron_tagger-4.17.1.tar.gz |
|---|---|
| Size | 78.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccda11e9c61cb80f38ca1ad9e2927630e54a14e637b39a1d4fd785d8af8d6e4c
|
|
BLAKE2b-256 checksum How to use checksums |
9f6948cbbeddf9a050a7da5edecd9bc3fedb7e9ad2554d0efa5dd074f9defaa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"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}
|
Release files / metron_tagger-4.17.1-py3-none-any.whl
| Download URL | metron_tagger-4.17.1-py3-none-any.whl |
|---|---|
| Size | 56.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
abe6cf2cc1c77085c788820657f6bf0e4db96e46c6b898f96e06e64e1fcf82c3
|
|
BLAKE2b-256 checksum How to use checksums |
b0c86d8d0e7fcc1e1b719f5db94339c90142b5b63458cc8168f5a4fb3a43f130
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"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}
|