GithubHelp home page GithubHelp logo

metron-project / mokkari Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 1.0 1.12 MB

Python wrapper for Metron API

License: GNU General Public License v3.0

Python 83.18% Makefile 7.76% Shell 3.32% JavaScript 5.74%
comic rest-api python comicbook comics

mokkari's Introduction

Mokkari

image

image

image

image

Quick Description

A python wrapper for the metron.cloud API.

Installation

PyPi

$ pip3 install --user mokkari

Example Usage

import mokkari

# Your own config file to keep your credentials secret
from config import username, password

m = mokkari.api(username, password)

# Get all Marvel comics for the week of 2021-06-07
this_week = m.issues_list({"store_date_range_after": "2021-06-07", "store_date_range_before": "2021-06-13", "publisher_name": "marvel"})

# Print the results
for i in this_week:
    print(f"{i.id} {i.issue_name}")

# Retrieve the detail for an individual issue
asm_68 = m.issue(31660)

# Print the issue Description
print(asm_68.desc)

Documentation

Bugs/Requests

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

License

This project is licensed under the GPLv3 License.

mokkari's People

Contributors

bpepple avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

buried-in-code

mokkari's Issues

Issue.issue_name not returned

Describe the bug
The Issue schema doesn't have issue_name marked as optional, however Metron doesn't always return this field and it doesn't raise an exception.

To Reproduce

  1. Make a call to result = session.issue(_id=39505)
  2. Try and access the issue_name field: result.issue_name
  3. An AttributeError is raised:

AttributeError: 'Issue' object has no attribute 'issue_name'

Expected behavior
It should either raise an exception or the field be Optional

Desktop (please complete the following information):

  • OS: Windows

Additional context

Add `Universe` Endpoint

Is your feature request related to a problem?
No

Describe the solution you'd like
Add support for new Metron API Universe endpoint.

Add option to have the sqlite cache expire

Is your feature request related to a problem? Please describe.
It would be nice to have an option to have the database cache expire at a certain length of time.

Describe the solution you'd like
Expose an option to set an optional expiration date for the database cache.

series_list returns 'display_name' instead of 'name' for Series objects

Describe the bug
When running a series_list search through mokkari, I'm getting results with a 'display_name' field instead of just 'name'. From what I can see, this includes the series start year in the name.

Expected behavior
It would be much nicer if the name field was returned without including a start year in brackets. The 'year_began' field already contains this information, and it makes name matching much more tedious when I have to first clean up the title before processing.

Screenshot 2023-10-04 at 2 16 04 pm

Extra Information
This seems to be a limitation of the API, not mokkari. When testing on the API page, you can see similar results for every Series object.

Screenshot 2023-10-04 at 2 25 34 pm

Contributor API, allow PUTs that go into editorial queue prior to committing to main DB

Is your feature request related to a problem? Please describe.
Not related to a bug but would allow for creation of automated pulling from contributor's backlog series/issues with metadata from various sources which may in turn increase contributions to the dataset.

Describe the solution you'd like
An API for PUT calls of all metadata related fields including ability to create series and feed new series ID to allow filling of all subsidiary info into the newly created series.

Suggested reference implementation:
Tagged library is parsed by shell/python script for metadata and series name
API call to cross check series' existence, auto-create with series name sent on API call and come back with new/existing series ID as applicable
Update each issue with 1 set of any metadata existing in the comic archives - so 1 API call for all metadata items of each issue
(optional but should be heavily encouraged) 1 more API call per issue to send the 1st page of the archive/Cover. This should have a 90% success rate or more with the people who are likely to share their metadata being usually serious collectors.
Move to next series once complete.

I do recommend each contributed series to go into the editorial queue, similar as they may for bulk website changes.

Describe alternatives you've considered
Anything but entering in (in my case) 41k issues by hand and uploading covers by hand.

Additional context
Many apologies if this is the wrong github issues page, I did look for the main project's page but this is the closest project to relevant I could find.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.