Skip to main content

Marvel API python wrapper.

Project description

Marvel API python wrapper.


This is a script which can be run at the beginning on the week to generate a complete Marvel pull list, excluding any series the user doesn’t want.

import os
import marvelous

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

# All the series IDs of comics I'm not interested in reading
# I pull these out of the resulting pulls.txt file, then rerun this script
IGNORE = set([
    19709, 20256, 19379, 19062, 19486, 19242, 19371, 19210, 20930, 21328,
    20834, 18826, 20933, 20365, 20928, 21129, 20786, 21402, 21018

# Authenticate with Marvel, with keys I got from
m = marvelous.api(public_key, private_key)

# Get all comics from this week, sorted alphabetically by title
# Uses the same API parameters as listed in the official API documentation
pulls = sorted(m.comics({
    'format': "comic",
    'formatType': "comic",
    'noVariants': True,
    'dateDescriptor': "thisWeek"}),
    key=lambda comic: comic.title)

# Grab the sale date of any of the comics for the folder name
directory = pulls[0].dates.on_sale.strftime('%m-%d')

# If there's no folder by that name, create one
if not os.path.exists(directory):

# Create a pulls.txt file in that folder
with open(directory + '/pulls.txt', 'w') as pull_checklist:
    # Check each comic that came out this week
    for comic in pulls:
        # If this series isn't in my ignore list
        if not in IGNORE:
            # Write a line to the file with the name of the issue, and the
            # id of the series incase I want to add it to my ignore list
            pull_checklist.write('{} (series #{})\n'.format(

Project details

Download files

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

Files for marvelous, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size marvelous-0.0.2.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page