Comicvine

Comicvine(api_key: str, timeout: int = 30, cache: Optional[SQLiteCache] = None)

Comicvine to request Comicvine API endpoints.

PARAMETER DESCRIPTION
api_key

User's API key to access the Comicvine API.

TYPE: str

timeout

Set how long requests will wait for a response (in seconds).

TYPE: int DEFAULT: 30

cache

SQLiteCache to use if set.

TYPE: Optional[SQLiteCache] DEFAULT: None

ATTRIBUTE DESCRIPTION
headers

Header used when requesting from Comicvine API.

TYPE: Dict[str, str]

api_key

User's API key to access the Comicvine API.

TYPE: str

timeout

How long requests will wait for a response (in seconds).

TYPE: int

cache

SQLiteCache to use if set.

TYPE: Optional[SQLiteCache]

Functions

character(character_id: int) -> Character

Request data for a Character based on its id.

PARAMETER DESCRIPTION
character_id

The Character id.

TYPE: int

RETURNS DESCRIPTION
Character

A Character object

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

character_list(params: Optional[Dict[str, Union[str, int]]] = None, max_results: int = 500) -> List[Character]

Request data for a list of Characters.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: Optional[Dict[str, Union[str, int]]] DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
List[Character]

A list of Character objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

creator(creator_id: int) -> Creator

Request data for a Creator based on its id.

PARAMETER DESCRIPTION
creator_id

The Creator id.

TYPE: int

RETURNS DESCRIPTION
Creator

A Creator object

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

creator_list(params: Optional[Dict[str, Union[str, int]]] = None, max_results: int = 500) -> List[Creator]

Request data for a list of Creators.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: Optional[Dict[str, Union[str, int]]] DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
List[Creator]

A list of Creator objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

issue(issue_id: int) -> Issue

Request data for an Issue based on its id.

PARAMETER DESCRIPTION
issue_id

The Issue id.

TYPE: int

RETURNS DESCRIPTION
Issue

A Issue object

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

issue_list(params: Optional[Dict[str, Union[str, int]]] = None, max_results: int = 500) -> List[Issue]

Request data for a list of Issues.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: Optional[Dict[str, Union[str, int]]] DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
List[Issue]

A list of Issue objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

publisher(publisher_id: int) -> Publisher

Request data for a Publisher based on its id.

PARAMETER DESCRIPTION
publisher_id

The Publisher id.

TYPE: int

RETURNS DESCRIPTION
Publisher

A Publisher object

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

publisher_list(params: Optional[Dict[str, Any]] = None, max_results: int = 500) -> List[Publisher]

Request data for a list of Publishers.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: Optional[Dict[str, Any]] DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
List[Publisher]

A list of Publisher objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

search(resource: ComicvineResource, query: str, max_results: int = 500) -> Union[List[Publisher], List[Volume], List[Issue], List[StoryArc], List[Creator], List[Character], List[Team]]

Request a list of search results filtered by provided resource.

PARAMETER DESCRIPTION
resource

Filter which type of resource to return.

TYPE: ComicvineResource

query

Search query string.

TYPE: str

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
Union[List[Publisher], List[Volume], List[Issue], List[StoryArc], List[Creator], List[Character], List[Team]]

A list of results, mapped to the given resource.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

story_arc(story_arc_id: int) -> StoryArc

Request data for a Story Arc based on its id.

PARAMETER DESCRIPTION
story_arc_id

The StoryArc id.

TYPE: int

RETURNS DESCRIPTION
StoryArc

A StoryArc object

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

story_arc_list(params: Optional[Dict[str, Union[str, int]]] = None, max_results: int = 500) -> List[StoryArc]

Request data for a list of Story Arcs.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: Optional[Dict[str, Union[str, int]]] DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
List[StoryArc]

A list of StoryArc objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

team(team_id: int) -> Team

Request data for a Team based on its id.

PARAMETER DESCRIPTION
team_id

The Team id.

TYPE: int

RETURNS DESCRIPTION
Team

A Team object

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

team_list(params: Optional[Dict[str, Union[str, int]]] = None, max_results: int = 500) -> List[Team]

Request data for a list of Teams.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: Optional[Dict[str, Union[str, int]]] DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
List[Team]

A list of Team objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

volume(volume_id: int) -> Volume

Request data for a Volume based on its id.

PARAMETER DESCRIPTION
volume_id

The Volume id.

TYPE: int

RETURNS DESCRIPTION
Volume

A Volume object

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

volume_list(params: Optional[Dict[str, Union[str, int]]] = None, max_results: int = 500) -> List[Volume]

Request data for a list of Volumes.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: Optional[Dict[str, Union[str, int]]] DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
List[Volume]

A list of Volume objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

ComicvineResource

Bases: Enum

Enum class for Comicvine Resources.

Attributes

CHARACTER = (4005, 'character', List[Character]) class-attribute

Details for the Character resource on Comicvine.

CREATOR = (4040, 'person', List[Creator]) class-attribute

Details for the Creator resource on Comicvine.

ISSUE = (4000, 'issue', List[Issue]) class-attribute

Details for the Issue resource on Comicvine.

PUBLISHER = (4010, 'publisher', List[Publisher]) class-attribute

Details for the Publisher resource on Comicvine.

STORY_ARC = (4045, 'story_arc', List[StoryArc]) class-attribute

Details for the Story Arc resource on Comicvine.

TEAM = (4060, 'team', List[Team]) class-attribute

Details for the Team resource on Comicvine.

VOLUME = (4050, 'volume', List[Volume]) class-attribute

Details for the Volume resource on Comicvine.

Functions

resource_id() -> int property

Start of id used by comicvine to create unique ids.

search_resource() -> str property

Resource string for filtering searches.

search_response() -> Type[T] property

Response type for resource when using a search endpoint.