Pymarvel Documentation Release 0.1.0

Pymarvel Documentation Release 0.1.0

PyMarvel Documentation Release 0.1.0 Garrett Pennington September 03, 2015 Contents 1 API 3 1.1 Marvel API to PyMarvel.........................................3 2 Marvel Module 7 3 Core Module 11 4 Character Module 17 5 Comic Module 19 6 Creator Module 21 7 Story Module 23 8 Series Module 25 9 Event Module 27 10 Documentation 29 11 Installation 31 12 Basic Usage 33 13 Response Anatomy 35 14 Related Resources 37 15 Pagination 39 16 Contributing 41 17 Licensing 43 Python Module Index 45 i ii PyMarvel Documentation, Release 0.1.0 Python wrapper for the Marvel API Contents 1 PyMarvel Documentation, Release 0.1.0 2 Contents CHAPTER 1 API Python wrapper for the Marvel API 1.1 Marvel API to PyMarvel get /v1/public/characters Fetches lists of characters. Marvel.get_characters() get /v1/public/characters/{characterId} Fetches a single character by id. Marvel.get_character() get /v1/public/characters/{characterId}/comics Fetches lists of comics filtered by a character id. Character.get_comics() get /v1/public/characters/{characterId}/events Fetches lists of events filtered by a character id. Character.get_events() get /v1/public/characters/{characterId}/series Fetches lists of series filtered by a character id. Character.get_series() get /v1/public/characters/{characterId}/stories Fetches lists of stories filtered by a character id. Character.get_stories() get /v1/public/comics Fetches lists of comics. X Marvel.get_comics() get /v1/public/comics/{comicId} Fetches a single comic by id. X Marvel.get_comic() get /v1/public/comics/{comicId}/characters Fetches lists of characters filtered by a comic id. Comic.get_characters() get /v1/public/comics/{comicId}/creators Fetches lists of creators filtered by a comic id. Comic.get_creators() get /v1/public/comics/{comicId}/events Fetches lists of events filtered by a comic id. Comic.get_events() 3 PyMarvel Documentation, Release 0.1.0 get /v1/public/comics/{comicId}/stories Fetches lists of stories filtered by a comic id. Comic.get_stories() get /v1/public/creators Fetches lists of creators. Marvel.get_creators() get /v1/public/creators/{creatorId} Fetches a single creator by id. Marvel.get_creator() get /v1/public/creators/{creatorId}/comics Fetches lists of comics filtered by a creator id. Creator.get_comics() get /v1/public/creators/{creatorId}/events Fetches lists of events filtered by a creator id. Creator.get_events() get /v1/public/creators/{creatorId}/series Fetches lists of series filtered by a creator id. Creator.get_series() get /v1/public/creators/{creatorId}/stories Fetches lists of stories filtered by a creator id. Creator.get_stories() get /v1/public/events Fetches lists of events. Marvel.get_events() get /v1/public/events/{eventId} Fetches a single event by id. Marvel.get_event() get /v1/public/events/{eventId}/characters Fetches lists of characters filtered by an event id. Event.get_characters() get /v1/public/events/{eventId}/comics Fetches lists of comics filtered by an event id. Event.get_comics() get /v1/public/events/{eventId}/creators Fetches lists of creators filtered by an event id. Event.get_creators() get /v1/public/events/{eventId}/series Fetches lists of series filtered by an event id. Event.get_series() get /v1/public/events/{eventId}/stories Fetches lists of stories filtered by an event id. Event.get_stories() get /v1/public/series Fetches lists of series. Marvel.get_series() get /v1/public/series/{seriesId} Fetches a single comic series by id. Marvel.get_series() get /v1/public/series/{seriesId}/characters Fetches lists of characters filtered by a series id. Series.get_characters() get /v1/public/series/{seriesId}/comics Fetches lists of comics filtered by a series id. Series.get_comics() 4 Chapter 1. API PyMarvel Documentation, Release 0.1.0 get /v1/public/series/{seriesId}/creators Fetches lists of creators filtered by a series id. Series.get_creators() get /v1/public/series/{seriesId}/events Fetches lists of events filtered by a series id. Series.get_events() get /v1/public/series/{seriesId}/stories Fetches lists of stories filtered by a series id. Series.get_stories() get /v1/public/stories Fetches lists of stories. Marvel.get_stories() get /v1/public/stories/{storyId} Fetches a single comic story by id. Marvel.get_story() get /v1/public/stories/{storyId}/characters Fetches lists of characters filtered by a story id. Story.get_characters() get /v1/public/stories/{storyId}/comics Fetches lists of comics filtered by a story id. Story.get_comics() get /v1/public/stories/{storyId}/creators Fetches lists of creators filtered by a story id. Story.get_creators() get /v1/public/stories/{storyId}/events Fetches lists of events filtered by a story id. Story.get_events() • genindex • modindex • search 1.1. Marvel API to PyMarvel 5 PyMarvel Documentation, Release 0.1.0 6 Chapter 1. API CHAPTER 2 Marvel Module class marvel.marvel.Marvel(public_key, private_key) Marvel API class This class provides methods to interface with the Marvel API >>> m= Marvel("acb123....","efg456...") get_character(id) Fetches a single character by id. get /v1/public/characters Parameters id – ID of Character Returns CharacterDataWrapper >>> m= Marvel(public_key, private_key) >>> cdw=m.get_character(1009718) >>> print cdw.data.count 1 >>> print cdw.data.results[0].name Wolverine get_characters(*args, **kwargs) Fetches lists of comic characters with optional filters. get /v1/public/characters/{characterId} Returns CharacterDataWrapper >>> m= Marvel(public_key, private_key) >>> cdw=m.get_characters(orderBy="name,-modified", limit="5", offset="15") >>> print cdw.data.count 1401 >>> for result in cdw.data.results: ... print result.name Aginar Air-Walker (Gabriel Lan) Ajak Ajaxis Akemi get_comic(id) Fetches a single comic by id. get /v1/public/comics/{comicId} 7 PyMarvel Documentation, Release 0.1.0 Parameters id – ID of Comic Returns ComicDataWrapper >>> m= Marvel(public_key, private_key) >>> cdw=m.get_comic(1009718) >>> print cdw.data.count 1 >>> print cdw.data.result.name Some Comic get_comics(*args, **kwargs) Fetches list of comics. get /v1/public/comics Returns ComicDataWrapper >>> m= Marvel(public_key, private_key) >>> cdw=m.get_comics(orderBy="issueNumber,-modified", limit="10", offset="15") >>> print cdw.data.count 10 >>> print cdw.data.results[0].name Some Comic get_creator(id) Fetches a single creator by id. get /v1/public/creators/{creatorId} Parameters id – ID of Creator Returns CreatorDataWrapper >>> m= Marvel(public_key, private_key) >>> cdw=m.get_creator(30) >>> print cdw.data.count 1 >>> print cdw.data.result.fullName Stan Lee get_creators(*args, **kwargs) Fetches lists of creators. get /v1/public/creators Returns CreatorDataWrapper >>> m= Marvel(public_key, private_key) >>> cdw=m.get_creators(lastName="Lee", orderBy="firstName,-modified", limit="5", offset="15") >>> print cdw.data.total 25 >>> print cdw.data.results[0].fullName Alvin Lee get_event(id) Fetches a single event by id. get /v1/public/event/{eventId} Parameters id – ID of Event Returns EventDataWrapper 8 Chapter 2. Marvel Module PyMarvel Documentation, Release 0.1.0 >>> m= Marvel(public_key, private_key) >>> response=m.get_event(253) >>> print response.data.result.title Infinity Gauntlet get_events(*args, **kwargs) Fetches lists of events. get /v1/public/events Returns EventDataWrapper >>> #Find all the events that involved both Hulk and Wolverine >>> #hulk's id: 1009351 >>> #wolverine's id: 1009718 >>> m= Marvel(public_key, private_key) >>> response=m.get_events(characters="1009351,1009718") >>> print response.data.total 38 >>> events= response.data.results >>> print events[1].title Age of Apocalypse get_series(*args, **kwargs) Fetches lists of events. get /v1/public/events Returns SeriesDataWrapper >>> #Find all the series that involved Wolverine >>> #wolverine's id: 1009718 >>> m= Marvel(public_key, private_key) >>> response=m.get_series(characters="1009718") >>> print response.data.total 435 >>> series= response.data.results >>> print series[0].title 5 Ronin (2010) get_single_series(id) Fetches a single comic series by id. get /v1/public/series/{seriesId} Parameters id – ID of Series Returns SeriesDataWrapper >>> m= Marvel(public_key, private_key) >>> response=m.get_single_series(12429) >>> print response.data.result.title 5 Ronin (2010) get_stories(*args, **kwargs) Fetches lists of stories. get /v1/public/stories Returns StoryDataWrapper 9 PyMarvel Documentation, Release 0.1.0 >>> #Find all the stories that involved both Hulk and Wolverine >>> #hulk's id: 1009351 >>> #wolverine's id: 1009718 >>> m= Marvel(public_key, private_key) >>> response=m.get_stories(characters="1009351,1009718") >>> print response.data.total 4066 >>> stories= response.data.results >>> print stories[1].title Cover #477 get_story(id) Fetches a single story by id. get /v1/public/stories/{storyId} Parameters id – ID of Story Returns StoryDataWrapper >>> m= Marvel(public_key, private_key) >>> response=m.get_story(29) >>> print response.data.result.title Caught in the heart of a nuclear explosion, mild-mannered scientist Bruce Banner finds himself... 10 Chapter 2. Marvel Module CHAPTER 3 Core Module class marvel.core.DataContainer(marvel, dict) Base DataContainer count The total number of results returned by this call. Returns int get_related_resource(_self, _Class, _ClassDataWrapper, *args, **kwargs) Takes a related resource Class and returns the related resource DataWrapper. For Example: Given a Character instance, return a ComicsDataWrapper related to that character. /character/{characterId}/comics Parameters • _Class (core.MarvelObject) – The Resource class retrieve •

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    52 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us