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[CharacterEntry]

Request data for a list of CharacterEntries.

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[CharacterEntry]

A list of CharacterEntry 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[CreatorEntry]

Request data for a list of CreatorEntries.

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[CreatorEntry]

A list of CreatorEntry 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[IssueEntry]

Request data for a list of IssueEntries.

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[IssueEntry]

A list of IssueEntry objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

location(location_id: int) -> Location

Request data for a Location based on its id.

PARAMETER DESCRIPTION
location_id

The Location id.

TYPE: int

RETURNS DESCRIPTION
Location

A Location object

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

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

Request data for a list of LocationEntries.

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[LocationEntry]

A list of LocationEntry 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[PublisherEntry]

Request data for a list of PublisherEntries.

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[PublisherEntry]

A list of PublisherEntry objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

search(resource: ComicvineResource, query: str, max_results: int = 500) -> Union[List[PublisherEntry], List[VolumeEntry], List[IssueEntry], List[StoryArcEntry], List[CreatorEntry], List[CharacterEntry], List[TeamEntry], List[LocationEntry]]

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[PublisherEntry], List[VolumeEntry], List[IssueEntry], List[StoryArcEntry], List[CreatorEntry], List[CharacterEntry], List[TeamEntry], List[LocationEntry]]

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 StoryArc 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[StoryArcEntry]

Request data for a list of StoryArcEntries.

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[StoryArcEntry]

A list of StoryArcEntry 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[TeamEntry]

Request data for a list of TeamEntries.

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[TeamEntry]

A list of TeamEntry 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[VolumeEntry]

Request data for a list of VolumeEntries.

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[VolumeEntry]

A list of VolumeEntry 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[CharacterEntry]) class-attribute

Details for the Character resource on Comicvine.

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

Details for the Creator resource on Comicvine.

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

Details for the Issue resource on Comicvine.

LOCATION = (4020, 'location', List[LocationEntry]) class-attribute

Details for the Location resource on Comicvine.

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

Details for the Publisher resource on Comicvine.

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

Details for the Story Arc resource on Comicvine.

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

Details for the Team resource on Comicvine.

VOLUME = (4050, 'volume', List[VolumeEntry]) 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.