Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0.0 #151

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Or install it yourself:

.. code:: bash

$ pip install --user metron-tagger
$ pipx install metron-tagger

FAQ
---
Expand All @@ -46,7 +46,7 @@ Help

::

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

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

Expand All @@ -57,19 +57,40 @@ Help
-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. (default: None)
-d, --delete Delete the metadata tags from the file. (default: False)
--ignore-existing Ignore files that have existing metadata tag. (default: False)
-i, --interactive Interactively query the user when there are matches for an online search. (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 ComicInfo.xml. (default: False)
--remove-non-valid Remove ComicInfo.xml from comic if not valid. Used with --validate option (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)
--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


Bugs/Requests
-------------

Expand Down
2 changes: 1 addition & 1 deletion metrontagger/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Projects version information used in setup.py."""

__version__ = "2.6.0"
__version__ = "3.0.0"
290 changes: 54 additions & 236 deletions metrontagger/schema/comicinfo/v1/ComicInfo.xsd
Original file line number Diff line number Diff line change
@@ -1,257 +1,75 @@
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:element name="ComicInfo" nillable="true" type="ComicInfo" />
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ComicInfo" nillable="true" type="ComicInfo"/>
<xs:complexType name="ComicInfo">
<xs:sequence>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Title"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Series"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Number"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default="-1"
name="Count"
type="xs:int"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default="-1"
name="Volume"
type="xs:int"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="AlternateSeries"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="AlternateNumber"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default="-1"
name="AlternateCount"
type="xs:int"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Summary"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Notes"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default="-1"
name="Year"
type="xs:int"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default="-1"
name="Month"
type="xs:int"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Writer"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Penciller"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Inker"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Colorist"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Letterer"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="CoverArtist"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Editor"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Publisher"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Imprint"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Genre"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Web"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default="0"
name="PageCount"
type="xs:int"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="LanguageISO"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default=""
name="Format"
type="xs:string"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default="Unknown"
name="BlackAndWhite"
type="YesNo"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
default="Unknown"
name="Manga"
type="YesNo"
/>
<xs:element
minOccurs="0"
maxOccurs="1"
name="Pages"
type="ArrayOfComicPageInfo"
/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Title" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Series" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Number" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Count" type="xs:int"/>
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Volume" type="xs:int"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="AlternateSeries" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="AlternateNumber" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="AlternateCount" type="xs:int"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Summary" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Notes" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Year" type="xs:int"/>
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Month" type="xs:int"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Writer" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Penciller" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Inker" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Colorist" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Letterer" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="CoverArtist" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Editor" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Publisher" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Imprint" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Genre" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Web" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="0" name="PageCount" type="xs:int"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="LanguageISO" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="" name="Format" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="BlackAndWhite" type="YesNo"/>
<xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="Manga" type="YesNo"/>
<xs:element minOccurs="0" maxOccurs="1" name="Pages" type="ArrayOfComicPageInfo"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="YesNo">
<xs:restriction base="xs:string">
<xs:enumeration value="Unknown" />
<xs:enumeration value="No" />
<xs:enumeration value="Yes" />
<xs:enumeration value="Unknown"/>
<xs:enumeration value="No"/>
<xs:enumeration value="Yes"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ArrayOfComicPageInfo">
<xs:sequence>
<xs:element
minOccurs="0"
maxOccurs="unbounded"
name="Page"
nillable="true"
type="ComicPageInfo"
/>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Page" nillable="true" type="ComicPageInfo"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ComicPageInfo">
<xs:attribute name="Image" type="xs:int" use="required" />
<xs:attribute default="Story" name="Type" type="ComicPageType" />
<xs:attribute default="false" name="DoublePage" type="xs:boolean" />
<xs:attribute default="0" name="ImageSize" type="xs:long" />
<xs:attribute default="" name="Key" type="xs:string" />
<xs:attribute default="-1" name="ImageWidth" type="xs:int" />
<xs:attribute default="-1" name="ImageHeight" type="xs:int" />
<xs:attribute name="Image" type="xs:int" use="required"/>
<xs:attribute default="Story" name="Type" type="ComicPageType"/>
<xs:attribute default="false" name="DoublePage" type="xs:boolean"/>
<xs:attribute default="0" name="ImageSize" type="xs:long"/>
<xs:attribute default="" name="Key" type="xs:string"/>
<xs:attribute default="-1" name="ImageWidth" type="xs:int"/>
<xs:attribute default="-1" name="ImageHeight" type="xs:int"/>
</xs:complexType>
<xs:simpleType name="ComicPageType">
<xs:list>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="FrontCover" />
<xs:enumeration value="InnerCover" />
<xs:enumeration value="Roundup" />
<xs:enumeration value="Story" />
<xs:enumeration value="Advertisement" />
<xs:enumeration value="Editorial" />
<xs:enumeration value="Letters" />
<xs:enumeration value="Preview" />
<xs:enumeration value="BackCover" />
<xs:enumeration value="Other" />
<xs:enumeration value="Deleted" />
<xs:enumeration value="FrontCover"/>
<xs:enumeration value="InnerCover"/>
<xs:enumeration value="Roundup"/>
<xs:enumeration value="Story"/>
<xs:enumeration value="Advertisement"/>
<xs:enumeration value="Editorial"/>
<xs:enumeration value="Letters"/>
<xs:enumeration value="Preview"/>
<xs:enumeration value="BackCover"/>
<xs:enumeration value="Other"/>
<xs:enumeration value="Deleted"/>
</xs:restriction>
</xs:simpleType>
</xs:list>
Expand Down
Loading
Loading