Skip to main content

An API Wrapper For Marvel API: https://developer.marvel.com

Project description

# Marvel API

Installation

Using pip:

pip install marvel

This is an API wrapper for [Marvel](https://developer.marvel.com/docs).

Usage

Usage is as simple as it gets:

from marvel import Marvel m = Marvel(PUBLIC_KEY, PRIVATE_KEY)

Now there are six objects presented namely, characters, comics, creators, events, series and stories as listed at [Developers](https://developers.zomato.com/documentation)

characters = m.characters comics = m.comics creators = m.creators events = m.events series = m.series stories = m.stories

Each of the above object returns back the appropriate response (json) as mentioned in official [docs](https://developer.marvel.com/docs)

Module Examples

Module Examples:

m = Marvel(PUBLIC_KEY, PRIVATE_KEY) characters = m.characters

Get All Characters:

all_characters = characters.all()

Get Single Character:

character = characters.get(1011334)

Get Some Character’s Comics:

comics = characters.comics(1011334)

Similarly, you could apply the same logic to different objects, an example:

m = Marvel(PUBLIC_KEY, PRIVATE_KEY) stories = m.stories all_stores = stories.all() story = stories.get(id) events = stories.events(id)

Finally, the sub resources that each object has are as follows:

  • Characters
    • all

    • get

    • comics

    • events

    • series

    • stories

  • Comics
    • all

    • get

    • characters

    • creators

    • events

    • stories

  • Creators
    • all

    • get

    • comics

    • events

    • series

    • stories

  • Events
    • all

    • get

    • characters

    • comics

    • creators

    • series

    • stories

  • Series
    • all

    • get

    • characters

    • comics

    • creators

    • events

    • stories

  • Stories
    • all

    • get

    • characters

    • comics

    • creators

    • events

    • series

# Exception Handling

You can catch any exception caused by Marvel API such as authentication error, bad input error, server down error, etc by handling the MarvelException at marvel/exceptions.py.

# Running Tests

python -m pytest tests/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marvel-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

marvel-0.1.0-py2.py3-none-any.whl (8.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file marvel-0.1.0.tar.gz.

File metadata

  • Download URL: marvel-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/3.6.5

File hashes

Hashes for marvel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39149db469a35dba8ad93b5f46ff64bc8c8714b681f0079cca015981d2eb4076
MD5 e2ec24df86b5f98a74eed7de4f091819
BLAKE2b-256 8fc03896ff109890028ab18866b4e362c8cb4a4f3896fd1e5fda2930aa05eb78

See more details on using hashes here.

File details

Details for the file marvel-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: marvel-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/3.6.5

File hashes

Hashes for marvel-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fa3f8ded061a22b1ec7315efb1c7c432ba56557261d9add6889a488b0d767188
MD5 8a09c1998594336726cd060ff2ff7fa4
BLAKE2b-256 4d320b82aa5baa39bad2a523ed383310019ecd09d5c62a6ecf2b030a023ea048

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page