mokkari package

Submodules

mokkari.arc module

Arc module.

This module provides the following classes:

  • Arc

  • ArcSchema

  • ArcsList

class mokkari.arc.Arc(**kwargs)

Bases: object

The Arc object contains information for story arcs.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting arc data from Metron.

id

The Metron identification number for the story arc.

Type:

int

name

The name of the story arc.

Type:

str

desc

The description of the story arc.

Type:

str

image

The url for an image associated with the story arc.

Type:

url

cv_id

Comic Vine ID for the story arc.

Type:

int

resource_url

The url for the resource.

Type:

url

modified

The date/time the story arc was last changed.

Type:

datetime

class mokkari.arc.ArcSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Arc API.

Changed in version 1.0.0:

  • Added modified field

Changed in version 2.3.3:

  • Added resource_url field.

New in version 2.4.0:

  • Added cv_id field.

class Meta

Bases: object

Any unknown fields will be excluded.

datetime = '%Y-%m-%dT%H:%M:%S%z'
unknown = 'exclude'
make_object(data, **kwargs)

Make the arc object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

An Arc object

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.arc.ArcsList(response)

Bases: object

The ArcsList object contains a list of story arcs.

id

The Metron identification number for the story arc.

Type:

int

name

The name of the story arc.

Type:

str

modified

The date/time the story arc was last changed.

Type:

datetime

Returns:

A list of story arcs.

mokkari.character module

Character module.

This module provides the following classes:

  • Character

  • CharacterSchema

  • CharactersList

class mokkari.character.Character(**kwargs)

Bases: object

The Character object contains information for characters.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting character data from Metron.

id

The Metron identification number for the character.

Type:

int

name

The name of the character.

Type:

str

alias

List of aliases the character may have.

Type:

list[str]

desc

The description of the character.

Type:

str

image

The url for an image associated with the character.

Type:

url

creators

A list of creators for the character.

Type:

list[Creator]

teams

A list of teams the character is a member of.

Type:

list[Team]

cv_id

Comic Vine ID for the Character.

Type:

int

resource_url

The url for the resource.

Type:

url

modified

The date/time the character was last changed.

Type:

datetime

class mokkari.character.CharacterSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Character API.

Changed in version 1.0.0:

  • Added modified field

Changed in version 2.0.2: - Removed wikipedia field

Changed in version 2.3.3:

  • Added resource_url field.

New in version 2.4.0:

  • Added cv_id field.

class Meta

Bases: object

Any unknown fields will be excluded.

datetime = '%Y-%m-%dT%H:%M:%S%z'
unknown = 'exclude'
make_object(data, **kwargs)

Make the character object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Character object

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.character.CharactersList(response)

Bases: object

The CharactersList object contains a list of characters.

id

The Metron identification number for the character.

Type:

int

name

The name of the character.

Type:

str

modified

The date/time the character was last changed.

Type:

datetime

Returns:

A list of characters.

mokkari.creator module

Creator module.

This module provides the following classes:

  • Creator

  • CreatorSchema

  • CreatorsList

class mokkari.creator.Creator(**kwargs)

Bases: object

The Creator object contains information for creators.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting creator data from Metron.

id

The Metron identification number for the creator.

Type:

int

name

The name of the creator.

Type:

str

birth

The date of birth for the creator.

Type:

date

death

The date of death for the creator.

Type:

date

desc

The description of the creator.

Type:

str

image

The url for an image associated with the creator.

Type:

url

cv_id

Comic Vine ID for the Creator.

Type:

int

resource_url

The url for the resource.

Type:

url

modified

The date/time the creator was last changed.

Type:

datetime

class mokkari.creator.CreatorSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Creator API.

Changed in version 1.0.0:

  • Added modified field

Changed in version 2.0.2:

  • Removed wikipedia field

Changed in version 2.3.3:

  • Added resource_url field.

New in version 2.4.0:

  • Added cv_id field.

class Meta

Bases: object

Any unknown fields will be excluded.

dateformat = '%Y-%m-%d'
datetime = '%Y-%m-%dT%H:%M:%S%z'
unknown = 'exclude'
make_object(data, **kwargs)

Make the Creator object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Creator object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.creator.CreatorsList(response)

Bases: object

The CreatorsList object contains a list of creators.

id

The Metron identification number for the creator.

Type:

int

name

The name of the creator.

Type:

str

modified

The date/time the creator was last changed.

Type:

datetime

Returns:

A list of creators.

mokkari.exceptions module

Exceptions module.

This module provides the following classes:

  • ApiError

  • AuthenticationError

  • CacheError

exception mokkari.exceptions.ApiError(*args, **kwargs)

Bases: Exception

Class for any api errors.

exception mokkari.exceptions.AuthenticationError(*args, **kwargs)

Bases: ApiError

Class for any authentication errors.

exception mokkari.exceptions.CacheError(*args, **kwargs)

Bases: ApiError

Class for any database cache errors.

mokkari.genre module

Genre Module.

This module provides the following classes:

  • Genre

  • GenreSchema

class mokkari.genre.Genre(**kwargs)

Bases: object

The Genre object contains information about a Series or Issue genre.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting genre data from Metron.

id

The Metron identification number for the genre.

Type:

int

name

The name of the genre.

Type:

str

class mokkari.genre.GenreSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Genre.

class Meta

Bases: object

Any unknown fields will be excluded.

unknown = 'exclude'
make_object(data, **kwargs)

Make the Genre object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Genre object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>

mokkari.issue module

Issue module.

This module provides the following classes:

  • Role

  • RolesSchema

  • RoleList

  • Credit

  • CreditsSchema

  • Issue

  • IssueSchema

  • IssuesList

class mokkari.issue.Credit(**kwargs)

Bases: object

The Credit object contains information for creators credits for an issue.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting credits data from Metron.

id

The Metron identification number for the credit.

Type:

int

creator

The name of the creator.

Type:

str

role

A list of roles for the creator.

Type:

RoleList

class mokkari.issue.CreditsSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Credits.

make_object(data, **kwargs)

Make the Credit object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Credit object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.issue.Issue(**kwargs)

Bases: object

The Issue object contains information for an issue.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting creator data from Metron.

id

The Metron identification number for the creator.

Type:

int

publisher

The publisher information for the issue.

Type:

Publisher

series

The series information for the issue.

Type:

Series

number

The issue number.

Type:

str

collection_title

The title of a Trade Paperback.

Type:

str

story_titles

A list of stories contained in the issue.

Type:

list[str]

cover_date

The cover date of the issue.

Type:

date

store_date

The date the issue went for sale.

Type:

date, optional

price

The price of the issue.

Type:

decimal

rating

The issue rating.

Type:

Rating

sku

Stock keeping unit for the issue.

Type:

str

upc

UPC barcode for the issue.

Type:

str

page_count

Number of pages for the issue.

Type:

int

desc

Summary description for the issue.

Type:

str

image

The url for a cover image associated with the issue.

Type:

url

cover_hash

A Perceptual hash string for the cover image.

Type:

str

arcs

A list of story arcs.

Type:

list[Arc]

credits

A list of creator credits for the issue.

Type:

list[Credit]

characters

A list of characters who appear in the issue.

Type:

list[Character]

teams

A list of teams who appear in the issue.

Type:

list[Team]

reprints

A list of reprinted issue contained in the issue.

Type:

list[Reprint]

issue_name

The name used to identified the issue.

Type:

str

variants

A list of variant covers for the issue.

Type:

list[Variant]

cv_id

Comic Vine ID for the issue.

Type:

int

resource_url

The url for the resource.

Type:

url

modified

The date/time the issue was last changed.

Type:

datetime

class mokkari.issue.IssueSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Issue API.

Changed in version 0.1.6:

  • name field changed to story_titles

  • __str__ field change to issue_name

Changed in version 0.2.0: Added price and sku fields

Changed in version 0.2.2: Added upc field

Changed in version 0.2.4:

  • Added page_count field

  • Changed price field from a string to float value.

Changed in version 1.0.0:

  • Changed price field to a decimal type.

  • Added modified field

Changed in version 2.1.0:

  • Add reprints field

New in version 2.2.2:

  • Add collection_title field

Changed in version 2.3.0:

  • Removed volume field. The series object will have that information.

Changed in version 2.3.2:

  • Added rating field.

Changed in version 2.3.3:

  • Added resource_url field.

New in version 2.4.0:

  • Added cv_id field.

New in version 2.6.0:

  • Add cover_hash field.

class Meta

Bases: object

Any unknown fields will be excluded.

datetime = '%Y-%m-%dT%H:%M:%S%z'
unknown = 'exclude'
make_object(data, **kwargs)

Make the issue object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

An Issue object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.issue.IssuesList(response)

Bases: object

The IssuesList object contains a list of issues.

id

The Metron identification number for the issue.

Type:

int

issue

The name of the issue.

Type:

str

cover_date

The cover date for the issue.

Type:

date

modified

The date/time the creator was last changed.

Type:

datetime

Returns:

A list of issues.

class mokkari.issue.Role(**kwargs)

Bases: object

The Role object contains information for creators’ role.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting role data from Metron.

id

The Metron identification number for the role.

Type:

int

name

The name of the role.

Type:

str

class mokkari.issue.RoleList(response)

Bases: object

The RoleList object contains a list of roles.

id

The Metron identification number for the role.

Type:

int

name

The name of the role.

Type:

str

Returns:

A list of roles.

class mokkari.issue.RolesSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Roles.

make_object(data, **kwargs)

Make the Role object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Role object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>

mokkari.publisher module

Publisher module.

This module provides the following classes:

  • Publisher

  • PublisherSchema

  • PublishersList

class mokkari.publisher.Publisher(**kwargs)

Bases: object

The Publisher object contains information for publishers.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting publisher data from Metron.

id

The Metron identification number for the publisher.

Type:

int

name

The name of the publisher.

Type:

str

founded

The year the publisher was founded.

Type:

int

desc

A summary description about the publisher.

Type:

str

image

The url for an image associated with the publisher.

Type:

url

cv_id

Comic Vine ID for the publisher.

Type:

int

resource_url

The url for the resource.

Type:

url

modified

The date/time the publisher was last changed.

Type:

datetime

class mokkari.publisher.PublisherSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Publisher API.

Changed in version 1.0.0:

  • Added modified field

Changed in version 2.0.2:

  • Removed wikipedia field

Changed in version 2.3.3:

  • Added resource_url field.

New in version 2.4.0:

  • Added cv_id field.

class Meta

Bases: object

Any unknown fields will be excluded.

datetime = '%Y-%m-%dT%H:%M:%S%z'
unknown = 'exclude'
make_object(data, **kwargs)

Make the Publisher object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Publisher object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.publisher.PublishersList(response)

Bases: object

The PublishersList object contains a list of publishers.

id

The Metron identification number for the publisher.

Type:

int

name

The name of the publisher.

Type:

str

modified

The date/time the publisher was last changed.

Type:

datetime

Returns:

A list of publishers.

mokkari.rating module

Rating module.

This module provides the following classes:

  • Rating

  • RatingSchema

class mokkari.rating.Rating(**kwargs)

Bases: object

The rating object contains information for issue’s rating.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting Rating data from Metron.

id

The Metron identification number for the rating.

Type:

int

name

The name of the rating.

Type:

str

class mokkari.rating.RatingSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for Ratings.

class Meta

Bases: object

Any unknown fields will be excluded.

unknown = 'exclude'
make_object(data, **kwargs)

Make the rating object.

Parameters:
  • data (Any) – Data from the Metron response

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

obj: Rating object.

Return type:

A

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>

mokkari.reprint module

Reprint module.

This module provides the following classes:

  • Reprint

  • ReprintSchema

  • ReprintsList

class mokkari.reprint.Reprint(**kwargs)

Bases: object

The Reprint object contains information for a reprint issue.

Parameters:
  • **kwargs (Any) – The keyword arguments is used for setting reprint issue

  • Metron. (data from) –

id

The Metron identification number for the issue.

Type:

int

issue

The name of the issue being reprinted.

Type:

str

class mokkari.reprint.ReprintSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Reprint API.

class Meta

Bases: object

Any unknown fields will be excluded.

unknown = 'exclude'
make_object(data, **kwargs)

Make the reprint object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Reprint object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>

mokkari.series module

Series module.

This module provides the following classes:

  • SeriesType

  • SeriesTypeSchema

  • Series

  • SeriesSchema

  • SeriesList

class mokkari.series.AssociatedSeries(**kwargs)

Bases: object

The AssociateSeries objects contains any associated series to the primary series.

Parameters:
  • **kwargs (Any) – The keyword arguments is used for setting associated series data

  • Metron. (from) –

id

The Metron identification number for the associated series.

Type:

int

name

The name of the associated series.

Type:

str

class mokkari.series.AssociatedSeriesSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for Associated Series.

make_object(data, **kwargs)

Make the AssociatedSeries object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

An AssociatedSeries object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.series.Series(**kwargs)

Bases: object

The Series object contains information for comic series.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting series data from Metron.

id

The Metron identification number for the series.

Type:

int

name

The name of the series.

Type:

str

sort_name

The name used to sort a series.

Type:

str

volume

The volume number for a series.

Type:

int

publisher

The publisher of the series.

Type:

Publisher

year_began

The cover year the series began.

Type:

int

year_end

The cover year in which the series ended.

Type:

int, optional

desc

A summary description of the series.

Type:

str

issue_count

The number of issues the series contains.

Type:

int

display_name

The display name for the series.

Type:

str

genres

A list of genres for the series.

Type:

list[Genre]

associated

A list of of series associated with the

Type:

list[AssociatedSeries]

primary series.
cv_id

Comic Vine ID for the series.

Type:

int

resource_url

The url for the resource.

Type:

url

modified

The date/time the series was last changed.

Type:

datetime

class mokkari.series.SeriesList(response)

Bases: object

The SeriesList object contains a list of series.

id

The Metron identification number for the series.

Type:

int

series

The name of the series.

Type:

str

modified

The date/time the series was last changed.

Type:

datetime

Returns:

A list of series.

class mokkari.series.SeriesSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Series API.

Changed in version 1.0.0:

  • Added modified field

Changed in version 1.0.5:

  • Added associated field

Changed in version 2.0.0:

  • Changed publisher to a nested field.

Changed in version 2.0.3: - Changed series_type to a string field.

Changed in version 2.0.4: - Reverted series_type back to a nested field.

Changed in version 2.1.1: Added genres fields

Changed in version 2.3.3:

  • Added resource_url field.

New in version 2.4.0:

  • Added cv_id field.

class Meta

Bases: object

Any unknown fields will be excluded.

datetime = '%Y-%m-%dT%H:%M:%S%z'
unknown = 'exclude'
make_object(data, **kwargs)

Make the Series object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Series object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.series.SeriesType(**kwargs)

Bases: object

The SeriesType object contains information for type of series.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting series type data from Metron.

id

The Metron identification number for the series type.

Type:

int

name

The name of the series type.

Type:

str

class mokkari.series.SeriesTypeList(response)

Bases: object

The SeriesTypeList object contains a list of series types.

id

The Metron identification number for the series type.

Type:

int

name

The name of the series type.

Type:

str

Returns:

A list of series types.

class mokkari.series.SeriesTypeSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Series Type.

make_object(data, **kwargs)

Make the SeriesType object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A SeriesType object.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>

mokkari.session module

Session module.

This module provides the following classes:

  • Session

class mokkari.session.Session(username: str, passwd: str, cache: SqliteCache | None = None, user_agent: str | None = None)

Bases: object

Session to request api endpoints.

Parameters:
  • username (str) – The username for authentication with metron.cloud

  • passwd (str) – The password used for authentication with metron.cloud

  • cache (SqliteCache, optional) – SqliteCache to use

  • optional (user_agent) – The user agent string for the application using Mokkari.

arc(_id: int) Arc

Request data for a story arc based on its _id.

Parameters:

_id (int) – The story arc id.

Returns:

A Arc object.

Raises:

ApiError – If there is a problem with the API request.

arc_issues_list(_id: int) List[Issue]

Request a list of issues for a story arc.

Parameters:

_id (int) – The arc id.

Returns:

A list of Issue objects.

arcs_list(params: Dict[str, str | int] | None = None) ArcsList

Request a list of story arcs.

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A ArcsList object.

character(_id: int) Character

Request data for a character based on its _id.

Parameters:

_id (int) – The character id.

Returns:

A Character object.

Raises:

ApiError – If there is a problem with the API request.

character_issues_list(_id: int) List[Issue]

Request a list of issues that a character appears in.

New in version 2.2.0.

Parameters:

_id (int) – The character id.

Returns:

A list of Issue objects.

characters_list(params: Dict[str, str | int] | None = None) CharactersList

Request a list of characters.

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A CharactersList object.

creator(_id: int) Creator

Request data for a creator based on its _id.

Parameters:

_id (int) – The creator id.

Returns:

A Creator object.

Raises:

ApiError – If there is a problem with the API request.

creators_list(params: Dict[str, str | int] | None = None) CreatorsList

Request a list of creators.

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A CreatorsList object.

issue(_id: int) Issue

Request data for an issue based on it’s _id.

Parameters:

_id (int) – The issue id.

Returns:

A Issue object.

Raises:

ApiError – If there is a problem with the API request.

issues_list(params: Dict[str, str | int] | None = None) IssuesList

Request a list of issues.

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A IssuesList object.

publisher(_id: int) Publisher

Request data for a publisher based on its _id.

Parameters:

_id (int) – The publisher id.

Returns:

A Publisher object.

Raises:

ApiError – If there is a problem with the API request.

publishers_list(params: Dict[str, str | int] | None = None) PublishersList

Request a list of publishers.

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A PublishersList object.

role_list(params: Dict[str, str | int] | None = None) RoleList

Request a list of creator roles.

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A RoleList object.

series(_id: int) Series

Request data for a series based on its _id.

Parameters:

_id (int) – The series id.

Returns:

A Series object.

Raises:

ApiError – If there is a problem with the API request.

series_list(params: Dict[str, str | int] | None = None) SeriesList

Request a list of series.

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A SeriesList object.

series_type_list(params: Dict[str, str | int] | None = None) SeriesTypeList

Request a list of series types.

New in version 2.2.2:

  • Add series_type_list method

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A SeriesTypeList object.

team(_id: int) Team

Request data for a team based on its _id.

Parameters:

_id (int) – The team id.

Returns:

A Team object.

Raises:

ApiError – If there is a problem with the API request.

team_issues_list(_id: int) List[Issue]

Request a list of issues that a team appears in.

New in version 2.2.0.

Parameters:

_id (int) – The team id.

Returns:

A list of Issue objects.

teams_list(params: Dict[str, str | int] | None = None) TeamsList

Request a list of teams.

Parameters:

params (dict, optional) – Parameters to add to the request.

Returns:

A TeamsList object.

mokkari.sqlite_cache module

SQLite Cache module.

This module provides the following classes:

  • SqliteCache

class mokkari.sqlite_cache.SqliteCache(db_name: str = 'mokkari_cache.db', expire: int | None = None)

Bases: object

The SqliteCache object to cache search results from Metron.

Parameters:
  • db_name (str) – Path and database name to use.

  • expire (int, optional) – The number of days to keep the cache results

  • expire. (before they) –

cleanup() None

Remove any expired data from the cache database.

get(key: str) Any | None

Retrieve data from the cache database.

Parameters:

key (str) – value to search for.

store(key: str, value: str) None

Save data to the cache database.

Parameters:
  • key (str) – Item id.

  • value (str) – data to save.

mokkari.team module

Team module.

This module provides the following classes:

  • Team

  • TeamSchema

  • TeamsList

class mokkari.team.Team(**kwargs)

Bases: object

The Team object contains information for teams.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting team data from Metron.

id

The Metron identification number for the team.

Type:

int

name

The name of the team.

Type:

str

desc

The description of the team.

Type:

str

image

The url for an image associated with the team.

Type:

url

creators

A list of creators for the team.

Type:

list[Creator]

cv_id

Comic Vine ID for the team.

Type:

int

resource_url

The url for the resource.

Type:

url

modified

The date/time the team was last changed.

Type:

datetime

class mokkari.team.TeamSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Team API.

Changed in version 1.0.0:

  • Added modified field

Changed in version 2.0.2: - Removed wikipedia field

Changed in version 2.3.3:

  • Added resource_url field.

New in version 2.4.0:

  • Added cv_id field.

class Meta

Bases: object

Any unknown fields will be excluded.

datetime = '%Y-%m-%dT%H:%M:%S%z'
unknown = 'exclude'
make_object(data, **kwargs)

Make the Team object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

A Team object

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class mokkari.team.TeamsList(response)

Bases: object

The TeamsList object contains a list of teams.

id

The Metron identification number for the team.

Type:

int

name

The name of the team.

Type:

str

modified

The date/time the team was last changed.

Type:

datetime

Returns:

A list of teams.

mokkari.variant module

Variant module.

This module provides the following classes:

  • Variant

  • VariantSchema

class mokkari.variant.Variant(**kwargs)

Bases: object

The Variant object contains information for variant issues.

Parameters:

**kwargs (Any) – The keyword arguments is used for setting arc data from Metron.

name

The name of the variant cover.

Type:

int

sku

The stock keeping unit for the variant cover.

Type:

str

image

The url for an image for the variant cover.

Type:

url

class mokkari.variant.VariantSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: Schema

Schema for the Variant API.

class Meta

Bases: object

Any unknown fields will be excluded.

unknown = 'exclude'
make_object(data, **kwargs)

Make the Variant object.

Parameters:
  • data (Any) – Data from Metron response.

  • **kwargs (Any) – Any additional keyword arguments.

Returns:

An Variant object

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>

Module contents

Project entry file.

mokkari.api(username: str | None = None, passwd: str | None = None, cache: SqliteCache | None = None, user_agent: str | None = None) Session

Entry function the sets login credentials for metron.cloud.

Parameters:
  • username (str) – The username used for metron.cloud.

  • passwd (str) – The password used for metron.cloud.

  • optional (user_agent) – SqliteCache to use

  • optional – The user agent string for the application using Mokkari.

  • Bar/1.0'. (For example 'Foo) –

Returns:

A Session object

Raises:

AuthenticationError – If Metron returns with an invalid API credentials response.

New in version 2.5.0:

  • Added user_agent argument.