Comicvine
Comicvine(api_key: str, timeout: int = 30, cache: SQLiteCache | None = None, user_agent: str | None = None)
Class with functionality to request Comicvine API endpoints.
| PARAMETER | DESCRIPTION |
|---|---|
api_key
|
User's API key to access the Comicvine API.
TYPE:
|
timeout
|
Set how long requests will wait for a response (in seconds).
TYPE:
|
cache
|
SQLiteCache to use if set.
TYPE:
|
user_agent
|
Custom User-Agent string. If None, uses default Simyan User-Agent.
TYPE:
|
Functions
get_character(character_id: int) -> Character
Request a Character using its id.
| PARAMETER | DESCRIPTION |
|---|---|
character_id
|
The Character id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Character
|
A Character object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_concept(concept_id: int) -> Concept
Request a Concept using its id.
| PARAMETER | DESCRIPTION |
|---|---|
concept_id
|
The Concept id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Concept
|
A Concept object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_creator(creator_id: int) -> Creator
Request a Creator using its id.
| PARAMETER | DESCRIPTION |
|---|---|
creator_id
|
The Creator id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Creator
|
A Creator object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_issue(issue_id: int) -> Issue
Request an Issue using its id.
| PARAMETER | DESCRIPTION |
|---|---|
issue_id
|
The Issue id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Issue
|
A Issue object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_item(item_id: int) -> Item
Request an Item using its id.
| PARAMETER | DESCRIPTION |
|---|---|
item_id
|
The Item id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Item
|
An Item object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_location(location_id: int) -> Location
Request a Location using its id.
| PARAMETER | DESCRIPTION |
|---|---|
location_id
|
The Location id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Location
|
A Location object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_origin(origin_id: int) -> Origin
Request an Origin using its id.
| PARAMETER | DESCRIPTION |
|---|---|
origin_id
|
The Origin id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Origin
|
An Origin object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_power(power_id: int) -> Power
Request a Power using its id.
| PARAMETER | DESCRIPTION |
|---|---|
power_id
|
The Power id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Power
|
A Power object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_publisher(publisher_id: int) -> Publisher
Request a Publisher using its id.
| PARAMETER | DESCRIPTION |
|---|---|
publisher_id
|
The Publisher id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Publisher
|
A Publisher object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_story_arc(story_arc_id: int) -> StoryArc
Request a Story Arc using its id.
| PARAMETER | DESCRIPTION |
|---|---|
story_arc_id
|
The StoryArc id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
StoryArc
|
A StoryArc object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_team(team_id: int) -> Team
Request a Team using its id.
| PARAMETER | DESCRIPTION |
|---|---|
team_id
|
The Team id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Team
|
A Team object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
get_volume(volume_id: int) -> Volume
Request a Volume using its id.
| PARAMETER | DESCRIPTION |
|---|---|
volume_id
|
The Volume id.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Volume
|
A Volume object or None if not found. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
list_characters(params: dict[str, Any] | None = None, max_results: int = 500) -> list[BasicCharacter]
Request a list of Characters.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicCharacter]
|
A list of Character 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[BasicConcept]
Request a list of Concepts.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicConcept]
|
A list of Concept 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[BasicCreator]
Request a list of Creators.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicCreator]
|
A list of Creator 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[BasicIssue]
Request a list of Issues.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicIssue]
|
A list of Issue 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[BasicItem]
Request a list of Items.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicItem]
|
A list of Item 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[BasicLocation]
Request a list of Locations.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicLocation]
|
A list of Location 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[BasicOrigin]
Request a list of Origins.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicOrigin]
|
A list of Origin 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[BasicPower]
Request a list of Powers.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicPower]
|
A list of Power 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[BasicPublisher]
Request a list of Publishers.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicPublisher]
|
A list of Publisher 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[BasicStoryArc]
Request a list of Story Arcs.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicStoryArc]
|
A list of StoryArc 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[BasicTeam]
Request a list of Teams.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicTeam]
|
A list of Team 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[BasicVolume]
Request a list of Volumes.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Parameters to add to the request.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicVolume]
|
A list of Volume objects. |
| RAISES | DESCRIPTION |
|---|---|
ServiceError
|
If there is an issue with validating the response. |
search(resource: ComicvineResource, query: str, max_results: int = 500) -> list[BasicPublisher] | list[BasicVolume] | list[BasicIssue] | list[BasicStoryArc] | list[BasicCreator] | list[BasicCharacter] | list[BasicTeam] | list[BasicLocation] | list[BasicConcept] | list[BasicPower] | list[BasicOrigin] | list[BasicItem]
Request a list of search results filtered by provided resource.
| PARAMETER | DESCRIPTION |
|---|---|
resource
|
Filter which type of resource to return.
TYPE:
|
query
|
Search query string.
TYPE:
|
max_results
|
Limits the amount of results looked up and returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BasicPublisher] | list[BasicVolume] | list[BasicIssue] | list[BasicStoryArc] | list[BasicCreator] | list[BasicCharacter] | list[BasicTeam] | list[BasicLocation] | list[BasicConcept] | list[BasicPower] | list[BasicOrigin] | list[BasicItem]
|
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[BasicCharacter])
class-attribute
instance-attribute
CONCEPT = (4015, 'concept', list[BasicConcept])
class-attribute
instance-attribute
CREATOR = (4040, 'person', list[BasicCreator])
class-attribute
instance-attribute
ISSUE = (4000, 'issue', list[BasicIssue])
class-attribute
instance-attribute
ITEM = (4055, 'object', list[BasicItem])
class-attribute
instance-attribute
LOCATION = (4020, 'location', list[BasicLocation])
class-attribute
instance-attribute
ORIGIN = (4030, 'origin', list[BasicOrigin])
class-attribute
instance-attribute
POWER = (4035, 'power', list[BasicPower])
class-attribute
instance-attribute
PUBLISHER = (4010, 'publisher', list[BasicPublisher])
class-attribute
instance-attribute
STORY_ARC = (4045, 'story_arc', list[BasicStoryArc])
class-attribute
instance-attribute
TEAM = (4060, 'team', list[BasicTeam])
class-attribute
instance-attribute
VOLUME = (4050, 'volume', list[BasicVolume])
class-attribute
instance-attribute
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.