comicbox.formats.base.transforms.identifiers

source module comicbox.formats.base.transforms.identifiers

Identifier Fields.

Functions

source identifiers_to_cb(native_identifiers: Any, naked_id_source: Any) → dict

Parse identifier struct from a string or sequence.

source identifiers_transform_to_cb(identifiers_tag: str, naked_id_source: IdSources) → MetaSpec

Transform identifier tags to comicbox identifiers.

source identifier_transform_from_cb(identifier_tag: str) → MetaSpec

Transform comicbox identifiers to one identifier tag.

For a format like CoMet that allows a single identifier, the best ranked source wins.

source identifier_from_url(url_str: str) → tuple[str, dict]

Parse an identifier out of a url comicbox recognizes.

Returns an empty result for a url from a database comicbox doesn’t know. Such a url is still kept verbatim in urls; inventing an identifier source from its hostname only produced keys nothing could look up.

source urls_to_cb(native_urls: Any) → list[str]

Collect url tags verbatim, in order, without duplicates.

source urls_transform_to_cb(urls_tag: str) → MetaSpec

Transform url tags to comicbox urls.

source urls_transform_from_cb(urls_tag: str) → MetaSpec

Transform comicbox urls to url tags.