Simyan package
Submodules
Simyan.creator module
Creator module.
This module provides the following classes:
Creator
CreatorSchema
- class Simyan.creator.Creator(**kwargs)
Bases:
object
The Creator object contains information for creators.
- Parameters
**kwargs – The keyword arguments is used for setting creator data from Comic Vine.
- class Simyan.creator.CreatorSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the Creator API.
- class Meta
Bases:
object
Any unknown fields will be excluded.
- dateformat = '%Y-%m-%d %H:%M:%S'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.creator.Creator
Make the Creator object.
- opts = <marshmallow.schema.SchemaOpts object>
- process_input(data, **kwargs)
Only keep the date of death information from Comic Vine.
The time zone info they include is not of any use.
- Parameters
data – Data from the Comic Vine response
Simyan.creator_list module
CreatorList module.
This module provides the following classes:
CreatorResult
CreatorResultSchema
CreatorList
- class Simyan.creator_list.CreatorList(response)
Bases:
object
The CreatorList object contains a list of CreatorResult objects.
- class Simyan.creator_list.CreatorResult(**kwargs)
Bases:
object
The CreatorResult object.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.creator_list.CreatorResultSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the CreatorResult API.
- class Meta
Bases:
object
Any unknown fields will be exclude.
- dateformat = '%Y-%m-%d %H:%M:%S'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.creator_list.CreatorResult
Make the CreatorResult object.
- Parameters
data – Data from the Comic Vine reponse.
- Returns
CreatorResult
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.exceptions module
Exceptions module.
This module provides the following classes:
ApiError
AuthenticationError
CacheError
- exception Simyan.exceptions.APIError
Bases:
Exception
Class for any api errors.
- exception Simyan.exceptions.AuthenticationError
Bases:
Simyan.exceptions.APIError
Class for any authentication errors.
- exception Simyan.exceptions.CacheError
Bases:
Simyan.exceptions.APIError
Class for any database cache errors.
Simyan.generic_entries module
Generic Entries module.
This module provides the following classes:
GenericEntry
GenericEntrySchema
CountEntry
CountEntrySchema
IssueEntry
IssueEntrySchema
CreatorEntry
CreatorEntrySchema
ImageEntry
ImageEntrySchema
- class Simyan.generic_entries.CountEntry(**kwargs)
Bases:
object
The CountEntry object contains count information.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.generic_entries.CountEntrySchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
Simyan.generic_entries.GenericEntrySchema
Schema for the CountEntry data.
- make_object(data, **kwargs) Simyan.generic_entries.CountEntry
Make the CountEntry object.
- Parameters
data – Data from the Comic Vine response.
- Returns
CountEntry
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
- class Simyan.generic_entries.CreatorEntry(**kwargs)
Bases:
object
The CreatorEntry object contains creator role information.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.generic_entries.CreatorEntrySchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
Simyan.generic_entries.GenericEntrySchema
Schema for the CreatorEntry data.
- make_object(data, **kwargs) Simyan.generic_entries.CreatorEntry
Make the CreatorEntry object.
- Parameters
data – Data from the Comic Vine response.
- Returns
CreatorEntry
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
- class Simyan.generic_entries.GenericEntry(**kwargs)
Bases:
object
The GenericEntry object contains generic information.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.generic_entries.GenericEntrySchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the GenericEntry data.
- make_object(data, **kwargs) Simyan.generic_entries.GenericEntry
Make the GenericEntry object.
- Parameters
data – Data from the Comic Vine response.
- Returns
GenericEntry
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
- class Simyan.generic_entries.ImageEntry(**kwargs)
Bases:
object
The ImageEntry object contains image information.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.generic_entries.ImageEntrySchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the ImageEntry data.
- make_object(data, **kwargs) Simyan.generic_entries.ImageEntry
Make the ImageEntry object.
- Parameters
data – Data from the Comic Vine response.
- Returns
ImageEntry
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
- class Simyan.generic_entries.IssueEntry(**kwargs)
Bases:
object
The IssueEntry object contains count information.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.generic_entries.IssueEntrySchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
Simyan.generic_entries.GenericEntrySchema
Schema for the IssueEntry data.
- make_object(data, **kwargs) Simyan.generic_entries.IssueEntry
Make the IssueEntry object.
- Parameters
data – Data from the Comic Vine response.
- Returns
IssueEntry
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.issue module
Issue module.
This module provides the following classes:
Issue
IssueSchema
- class Simyan.issue.Issue(**kwargs)
Bases:
object
The Issue object contains information for an issue.
- Parameters
**kwargs – The keyword arguments is used for setting issue data from Comic Vine.
- class Simyan.issue.IssueSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the Issue API.
- class Meta
Bases:
object
Any unknown fields will be excluded.
- dateformat = '%Y-%m-%d'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.issue.Issue
Make the issue object.
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.issue_list module
IssuesList module.
This module provides the following classes:
IssueResult
IssueResultSchema
IssuesList
- class Simyan.issue_list.IssueList(response)
Bases:
object
The IssuesList object contains a list of IssueResult objects.
- class Simyan.issue_list.IssueResult(**kwargs)
Bases:
object
The IssueResult object contains information for an issue.
- Parameters
**kwargs – The keyword arguments is used for setting issue data from Comic Vine.
- class Simyan.issue_list.IssueResultSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the IssueResult API.
- class Meta
Bases:
object
Any unknown fields will be excluded.
- dateformat = '%Y-%m-%d'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.issue_list.IssueResult
Make the IssueResult object.
- Parameters
data – Data from Comic Vine response.
- Returns
IssueResult
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.publisher module
Publisher module.
This module provides the following classes:
Publisher
PublisherSchema
- class Simyan.publisher.Publisher(**kwargs)
Bases:
object
The Publisher object contains information for publishers.
- Parameters
**kwargs – The keyword arguments is used for setting publisher data from Comic Vine.
- class Simyan.publisher.PublisherSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the Publisher API.
- class Meta
Bases:
object
Any unknown fields will be excluded.
- dateformat = '%Y-%m-%d'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.publisher.Publisher
Make the arc object.
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.publisher_list module
PublishersList module.
This module provides the following classes:
PublisherResult
PublisherResultSchema
PublishersList
- class Simyan.publisher_list.PublisherList(response)
Bases:
object
The PublishersList object contains a list of PublisherResult objects.
- class Simyan.publisher_list.PublisherResult(**kwargs)
Bases:
object
The PublisherResult object contains information for a publisher.
- Parameters
**kwargs – The keyword arguments is used for setting publisher data from Comic Vine.
- class Simyan.publisher_list.PublisherResultSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the PublisherResult API.
- class Meta
Bases:
object
Any unknown fields will be excluded.
- dateformat = '%Y-%m-%d'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.publisher_list.PublisherResult
Make the PublisherResult object.
- Parameters
data – Data from the Comic Vine response.
- Returns
PublisherResult
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.session module
Session module.
This module provides the following classes:
Session
- class Simyan.session.CVType(value)
Bases:
enum.Enum
Class for Comic Vine resource ids.
- CREATOR = 4040
- ISSUE = 4000
- PUBLISHER = 4010
- STORY_ARC = 4045
- VOLUME = 4050
- class Simyan.session.Session(api_key: str, cache: Optional[Simyan.sqlite_cache.SqliteCache] = None)
Bases:
object
Session to request api endpoints.
- Parameters
api_key (str) – The api key used for authentication with Comic Vine
optional (SqliteCache,) – SqliteCache to use
- call(endpoint: List[Union[str, int]], params: Dict[str, Union[str, int]] = None) Dict[str, Any]
Make request for api endpoints.
- Parameters
endpoint (list[str, int]) – The endpoint to request information from.
params (dict) – Parameters to add to the request.
- creator(_id: int) Simyan.creator.Creator
Request data for a creator based on its
_id
.- Parameters
_id (int) – The creator id.
- Returns
Creator
object- Return type
- creator_list(params: Optional[Dict[str, Union[str, int]]] = None) Simyan.creator_list.CreatorList
Request a list of creators.
- Parameters
params (dict, optional) – Parameters to add to the request.
- Returns
A list of
CreatorResult
objects.- Return type
CreatorsList
- issue(_id: int) Simyan.issue.Issue
Request data for an issue based on it’s
_id
.- Parameters
_id (int) – The issue id.
- Returns
Issue
object- Return type
- issue_list(params: Optional[Dict[str, Union[str, int]]] = None) Simyan.issue_list.IssueList
Request a list of issues.
- Parameters
params (dict, optional) – Parameters to add to the request.
- Returns
A list of
IssueResult
objects.- Return type
IssuesList
- publisher(_id: int) Simyan.publisher.Publisher
Request data for a publisher based on its
_id
.- Parameters
_id (int) – The publisher id.
- Returns
Publisher
object- Return type
- publisher_list(params: Optional[Dict[str, Union[str, int]]] = None) Simyan.publisher_list.PublisherList
Request a list of publishers.
- Parameters
params (dict, optional) – Parameters to add to the request.
- Returns
A list of
PublisherResult
objects.- Return type
PublishersList
- story_arc(_id: int) Simyan.story_arc.StoryArc
Request data for a story arc based on its
_id
.- Parameters
_id (int) – The story arc id.
- Returns
StoryArc
object- Return type
- story_arc_list(params: Optional[Dict[str, Union[str, int]]] = None) Simyan.story_arc_list.StoryArcList
Request a list of story arc.
- Parameters
params (dict, optional) – Parameters to add to the request.
- Returns
A list of
StoryArcResult
objects.- Return type
- volume(_id: int) Simyan.volume.Volume
Request data for a volume based on its
_id
.- Parameters
_id (int) – The volume id.
- Returns
Volume
object- Return type
- volume_list(params: Optional[Dict[str, Union[str, int]]] = None) Simyan.volume_list.VolumeList
Request a list of volumes.
- Parameters
params (dict, optional) – Parameters to add to the request.
- Returns
A list of
Volumeresult
objects.- Return type
Simyan.sqlite_cache module
SQLite Cache module.
This module provides the following classes:
SqliteCache
- class Simyan.sqlite_cache.SqliteCache(name: str = 'Simyan-Cache.sqlite', expiry: Optional[int] = 14)
Bases:
object
The SqliteCache object to cache search results from Comic Vine.
- Parameters
db_name (str) – Path and database name to use.
expiry (optional, int) – How long to keep cache results.
- delete()
Remove data from the cache database.
- get(key: str) Optional[Dict[str, Any]]
Retrieve data from the cache database.
- Parameters
key (str) – value to search for.
- insert(query: str, response: str)
Insert data into the cache database.
- Parameters
query (str) – Search string.
response (str) – data to save.
- select(query: str) Dict[str, Any]
Statement to retrieve data from the cache database.
- Parameters
query (str) – Search string.
- store(key: str, value: str)
Save data to the cache database.
- Parameters
key (str) – Item id.
value (str) – data to save.
Simyan.story_arc module
StoryArc module.
This module provides the following classes:
StoryArc
StoryArcSchema
- class Simyan.story_arc.StoryArc(**kwargs)
Bases:
object
The StoryArc object contains information for story arcs.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.story_arc.StoryArcSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the StoryArc API.
- class Meta
Bases:
object
Any unknown fields will be excluded.
- dateformat = '%Y-%m-%d %H:%M:%S'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.story_arc.StoryArc
Make the story arc object.
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.story_arc_list module
Story Arc List module.
This module provides the following classes:
StoryArcResult
StoryArcResultSchema
StoryArcList
- class Simyan.story_arc_list.StoryArcList(response)
Bases:
object
The StoryArcsList object contains a list of StoryArcResult objects.
- class Simyan.story_arc_list.StoryArcResult(**kwargs)
Bases:
object
The StoryArcResult object contains information for story arcs.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.story_arc_list.StoryArcResultSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the StoryArcResult API.
- class Meta
Bases:
object
Any unknown fields will be excluded.
- dateformat = '%Y-%m-%d %H:%M:%S'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.story_arc_list.StoryArcResult
Make the StoryArcResult object.
- Parameters
data – Data from the Comic Vine response.
- Returns
StoryArcResult
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.volume module
Volume module.
This module provides the following classes:
Volume
VolumeSchema
- class Simyan.volume.Volume(**kwargs)
Bases:
object
The Volume object contains information for comic volume.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.volume.VolumeSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the Volume API.
- class Meta
Bases:
object
Any unknown fields will be excluded.
- dateformat = '%Y-%m-%d %H:%M:%S'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.volume.Volume
Make the Volume object.
- opts = <marshmallow.schema.SchemaOpts object>
Simyan.volume_list module
VolumeList module.
This module provides the following classes:
VolumeResult
VolumeResultSchema
VolumeList
- class Simyan.volume_list.VolumeList(response)
Bases:
object
The VolumeList object contains a list of VolumeResult objects.
- class Simyan.volume_list.VolumeResult(**kwargs)
Bases:
object
The VolumeResult object contains information for comic volumes.
- Parameters
**kwargs – The keyword arguments is used for setting data from Comic Vine.
- class Simyan.volume_list.VolumeResultSchema(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
marshmallow.schema.Schema
Schema for the VolumeResult API.
- class Meta
Bases:
object
Any unknown fields will be included.
- dateformat = '%Y-%m-%d %H:%M:%S'
- datetimeformat = '%Y-%m-%d %H:%M:%S'
- unknown = 'exclude'
- make_object(data, **kwargs) Simyan.volume_list.VolumeResult
Make the VolumeResult object.
- Parameters
data – Data from the Comic Vine response.
- Returns
VolumeResult
object- Return type
- opts = <marshmallow.schema.SchemaOpts object>
Module contents
Project entry file.
- Simyan.api(api_key: Optional[str] = None, cache: Optional[Simyan.sqlite_cache.SqliteCache] = None) Simyan.session.Session
Entry function that sets credentials to use the Comic Vine API, and whether to use a database cache for results.
- Parameters
api_key (str, optional) – User’s api key to access the Comic Vine api.
optional (SqliteCache) – SqliteCache to use