Skip to content

Comicvine

Comicvine(api_key: str, timeout: int = 30, cache: SQLiteCache | None = 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: SQLiteCache | None 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

get_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: ServiceError: If there is an issue with validating the response.

get_concept(concept_id: int) -> Concept

Request data for a Concept based on its id.

PARAMETER DESCRIPTION
concept_id

The Concept id.

TYPE: int

RETURNS DESCRIPTION
Concept

A Concept object

Raises: ServiceError: If there is an issue with validating the response.

get_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: ServiceError: If there is an issue with validating the response.

get_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: ServiceError: If there is an issue with validating the response.

get_item(item_id: int) -> Item

Request data for an Item based on its id.

PARAMETER DESCRIPTION
item_id

The Item id.

TYPE: int

RETURNS DESCRIPTION
Item

A Item object

Raises: ServiceError: If there is an issue with validating the response.

get_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: ServiceError: If there is an issue with validating the response.

get_origin(origin_id: int) -> Origin

Request data for an Origin based on its id.

PARAMETER DESCRIPTION
origin_id

The Origin id.

TYPE: int

RETURNS DESCRIPTION
Origin

A Origin object

Raises: ServiceError: If there is an issue with validating the response.

get_power(power_id: int) -> Power

Request data for a Power based on its id.

PARAMETER DESCRIPTION
power_id

The Power id.

TYPE: int

RETURNS DESCRIPTION
Power

A Power object

Raises: ServiceError: If there is an issue with validating the response.

get_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: ServiceError: If there is an issue with validating the response.

get_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: ServiceError: If there is an issue with validating the response.

get_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: ServiceError: If there is an issue with validating the response.

get_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: ServiceError: If there is an issue with validating the response.

list_characters(params: dict[str, Any] | None = None, max_results: int = 500) -> list[CharacterEntry]

Request data for a list of Characters.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None 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.

list_concepts(params: dict[str, Any] | None = None, max_results: int = 500) -> list[ConceptEntry]

Request data for a list of Concepts.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
list[ConceptEntry]

A list of ConceptEntry objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

list_creators(params: dict[str, Any] | None = None, max_results: int = 500) -> list[CreatorEntry]

Request data for a list of Creators.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None 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.

list_issues(params: dict[str, Any] | None = None, max_results: int = 500) -> list[IssueEntry]

Request data for a list of Issues.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None 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.

list_items(params: dict[str, Any] | None = None, max_results: int = 500) -> list[ItemEntry]

Request data for a list of Items.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
list[ItemEntry]

A list of ItemEntry objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

list_locations(params: dict[str, Any] | None = None, max_results: int = 500) -> list[LocationEntry]

Request data for a list of Locations.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None 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.

list_origins(params: dict[str, Any] | None = None, max_results: int = 500) -> list[OriginEntry]

Request data for a list of Origins.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
list[OriginEntry]

A list of OriginEntry objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

list_powers(params: dict[str, Any] | None = None, max_results: int = 500) -> list[PowerEntry]

Request data for a list of Powers.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None DEFAULT: None

max_results

Limits the amount of results looked up and returned.

TYPE: int DEFAULT: 500

RETURNS DESCRIPTION
list[PowerEntry]

A list of PowerEntry objects.

RAISES DESCRIPTION
ServiceError

If there is an issue with validating the response.

list_publishers(params: dict[str, Any] | None = None, max_results: int = 500) -> list[PublisherEntry]

Request data for a list of Publishers.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None 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.

list_story_arcs(params: dict[str, Any] | None = None, max_results: int = 500) -> list[StoryArcEntry]

Request data for a list of Story Arcs.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None 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.

list_teams(params: dict[str, Any] | None = None, max_results: int = 500) -> list[TeamEntry]

Request data for a list of Teams.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None 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.

list_volumes(params: dict[str, Any] | None = None, max_results: int = 500) -> list[VolumeEntry]

Request data for a list of Volumes.

PARAMETER DESCRIPTION
params

Parameters to add to the request.

TYPE: dict[str, Any] | None 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.

search(resource: ComicvineResource, query: str, max_results: int = 500) -> list[PublisherEntry] | list[VolumeEntry] | list[IssueEntry] | list[StoryArcEntry] | list[CreatorEntry] | list[CharacterEntry] | list[TeamEntry] | list[LocationEntry] | list[ConceptEntry] | list[PowerEntry] | list[OriginEntry] | list[ItemEntry]

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
list[PublisherEntry] | list[VolumeEntry] | list[IssueEntry] | list[StoryArcEntry] | list[CreatorEntry] | list[CharacterEntry] | list[TeamEntry] | list[LocationEntry] | list[ConceptEntry] | list[PowerEntry] | list[OriginEntry] | list[ItemEntry]

A list of results, mapped to the given resource.

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 instance-attribute

Details for the Character resource on Comicvine.

CONCEPT = (4015, 'concept', List[ConceptEntry]) class-attribute instance-attribute

Details for the Concept resource on Comicvine.

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

Details for the Creator resource on Comicvine.

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

Details for the Issue resource on Comicvine.

ITEM = (4055, 'object', List[ItemEntry]) class-attribute instance-attribute

Details for the Item resource on Comicvine.

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

Details for the Location resource on Comicvine.

ORIGIN = (4030, 'origin', List[OriginEntry]) class-attribute instance-attribute

Details for the Origin resource on Comicvine.

POWER = (4035, 'power', List[PowerEntry]) class-attribute instance-attribute

Details for the Power resource on Comicvine.

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

Details for the Publisher resource on Comicvine.

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

Details for the Story Arc resource on Comicvine.

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

Details for the Team resource on Comicvine.

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

Details for the Volume resource on Comicvine.

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.