Skip to content

Metron-Project/esak

Repository files navigation

esak - Python wrapper for Marvel API

PyPI - Python PyPI - Version PyPI - License

pre-commit Ruff

Github - Contributors Github Action - Testing Codecov

Read the Docs

This project is a fork of marvelous with the goal of supporting the full Marvel API.

Installation

pip install --user esak

Example Usage

import esak

# Your own config file to keep your private key local and secret
from config import public_key, private_key

# Authenticate with Marvel, with keys I got from http://developer.marvel.com/
m = esak.api(public_key, private_key)

# Get all comics from this week, sorted alphabetically by title
pulls = sorted(m.comics_list({
    'format': "comic",
    'formatType': "comic",
    'noVariants': True,
    'dateDescriptor': "thisWeek",
    'limit': 100}),
    key=lambda comic: comic.title)

for comic in pulls:
    # Write a line to the file with the name of the issue, and the id of the series
    print(f'{comic.title} (series #{comic.series.id})')

Documentation

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features.

Contributing

  • When running a new test for the first time, set the environment variables PUBLIC_KEY and PRIVATE_KEY to your Marvel API keys. The responses will be cached in the tests/testing_mock.sqlite database without your keys.

Socials

Social - Matrix Social - Matrix