Skip to content
Marvel entertainment and visualizations
  • AI Chat
  • Code
  • Report
  • Getting insights from Marvel comics

    !pip install marvel 
    from marvel import Marvel
    from configparser import ConfigParser
    parser = ConfigParser()
    _ = parser.read('notebook.cfg')
    PUBLIC_KEY  = parser.get('my_api', 'PUBLIC_KEY')
    PRIVATE_KEY = parser.get('my_api', 'PRIVATE_KEY')
    
    m = Marvel(PUBLIC_KEY, PRIVATE_KEY)
    
    characters = m.characters 
    x = 1011334 
    for n in range (0, 6): 
        # serach for comics of this character
        all_characters=characters.comics(x) 
          
        x = x+1 
        for i in range (1,12):
          print(all_characters['data']['results'][int(i)]['title'])

    References and guides

    • Keeping credentials safe in Jupyter Notebooks
    • Find comics of marvel superhero using marvel API in Python
    • marvel 0.1.0 pypi documentation