mokkari package
Subpackages
- mokkari.schemas package
- Submodules
- mokkari.schemas.arc module
- mokkari.schemas.character module
Character
Character.alias
Character.desc
Character.image
Character.creators
Character.teams
Character.cv_id
Character.resource_url
Character.alias
Character.creators
Character.cv_id
Character.desc
Character.image
Character.model_computed_fields
Character.model_config
Character.model_fields
Character.resource_url
Character.teams
Character.universes
- mokkari.schemas.creator module
- mokkari.schemas.generic module
- mokkari.schemas.issue module
BaseIssue
BasicSeries
CommonIssue
CommonIssue.id
CommonIssue.number
CommonIssue.cover_date
CommonIssue.image
CommonIssue.cover_hash
CommonIssue.modified
CommonIssue.cover_date
CommonIssue.cover_hash
CommonIssue.id
CommonIssue.image
CommonIssue.model_computed_fields
CommonIssue.model_config
CommonIssue.model_fields
CommonIssue.modified
CommonIssue.number
Credit
Issue
Issue.publisher
Issue.series
Issue.collection_title
Issue.story_titles
Issue.cover_date
Issue.store_date
Issue.price
Issue.rating
Issue.sku
Issue.isbn
Issue.upc
Issue.page_count
Issue.desc
Issue.arcs
Issue.credits
Issue.characters
Issue.teams
Issue.reprints
Issue.variants
Issue.cv_id
Issue.resource_url
Issue.arcs
Issue.characters
Issue.collection_title
Issue.cover_date
Issue.credits
Issue.cv_id
Issue.desc
Issue.isbn
Issue.model_computed_fields
Issue.model_config
Issue.model_fields
Issue.page_count
Issue.price
Issue.publisher
Issue.rating
Issue.reprints
Issue.resource_url
Issue.series
Issue.sku
Issue.store_date
Issue.story_titles
Issue.teams
Issue.universes
Issue.upc
Issue.variants
IssueSeries
IssueSeries.id
IssueSeries.name
IssueSeries.sort_name
IssueSeries.volume
IssueSeries.series_type
IssueSeries.genres
IssueSeries.genres
IssueSeries.id
IssueSeries.model_computed_fields
IssueSeries.model_config
IssueSeries.model_fields
IssueSeries.name
IssueSeries.series_type
IssueSeries.sort_name
IssueSeries.volume
- mokkari.schemas.publisher module
- mokkari.schemas.reprint module
- mokkari.schemas.series module
AssociatedSeries
BaseSeries
CommonSeries
Series
Series.name
Series.sort_name
Series.volume
Series.series_type
Series.publisher
Series.year_end
Series.desc
Series.cv_id
Series.resource_url
Series.associated
Series.cv_id
Series.desc
Series.genres
Series.model_computed_fields
Series.model_config
Series.model_fields
Series.name
Series.publisher
Series.resource_url
Series.series_type
Series.sort_name
Series.volume
Series.year_end
- mokkari.schemas.team module
- mokkari.schemas.variant module
- Module contents
Submodules
mokkari.exceptions module
Exceptions module.
This module provides the following classes:
ApiError
AuthenticationError
CacheError
- exception mokkari.exceptions.ApiError(*args, **kwargs: dict[str, any])
Bases:
Exception
Class for any api errors.
- exception mokkari.exceptions.AuthenticationError(*args, **kwargs: dict[str, any])
Bases:
Exception
Class for any authentication errors.
- exception mokkari.exceptions.CacheError(*args, **kwargs: dict[str, any])
Bases:
Exception
Class for any database cache errors.
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[BaseIssue]
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) list[BaseResource]
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[BaseIssue]
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) list[BaseResource]
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) list[BaseResource]
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) list[BaseIssue]
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) list[BaseResource]
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) list[GenericItem]
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) list[BaseSeries]
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) list[GenericItem]
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[BaseIssue]
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) list[BaseResource]
Request a list of teams.
- Parameters:
params (dict, optional) – Parameters to add to the request.
- Returns:
A
TeamsList
object.
- universe(_id: int) Universe
Request data for a universe based on its
_id
.- Parameters:
_id (int) – The universe id.
- Returns:
A
Universe
object.- Raises:
ApiError – If there is a problem with the API request.
- universes_list(params: dict[str, str | int] | None = None) list[BaseResource]
Request a list of universes.
- Parameters:
params (dict, optional) – Parameters to add to the request.
- Returns:
A list of
BaseUniverse
objects.
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.
Module contents
Project entry file.
- mokkari.api(username: str | None = None, passwd: str | None = None, cache: SqliteCache = 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.
cache (SqliteCache) – SqliteCache to use
user_agent (str) – 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.