Skip to main content

Python MyAnimeList v2 API wrapper.

Project description

pyMALv2

Python API wrapper for MyAnimeList, supporting MAL version 2 api.

Note: This is a work in progress and many endpoints have not been implemented. Expect a lot of bugs.

Installation

pip install pyMALv2

or

python setup.py install

Usage

Basic Usage:

from pyMALv2.auth import Authorization, OAuth
from pyMALv2.services import UserService

# Create an oauth client.
client = OAuth(
    client_id='your_client_id',
    client_secret='your_client_secret',
    redirect_uri='https://your-redirect-url.com'
)

# Start the oauth flow, starts a http server to receive authorization code.
client.start_oauth2_flow(http_server=True, port=8989)

# Create an authorization object.
auth = Authorization().load_token(
    access_token=client.tokens.access_token,
    refresh_token=client.tokens.refresh_token,
    expires_in=client.tokens.expires_in,
)

# Create service
user = UserService(auth)

# Get anime list
anime_list = user.anime_list.get()
# Returns a list of anime objects.

Add/Update/Delete entry to user's anime or manga list:

user = UserService(auth)
user.anime_list.update(Anime(id=43608), status='watching')
user.manga_list.delete(12)

See examples/example1.py for an example on storing the tokens in a file so that you don't have to keep re-authorizing everytime your script runs. If you've ever worked with the google python api, it looks very similar.

Data returned from some functions are json objects deserialised to python objects analogous to the MALv2 API. So please refer to the MAL API for more information.

For more information, inspect the source code or MAL api docs. Wrapper API docs are not yet available.

Currently Implemented Endpoints

Contributing

Contributions are welcome. Please fork the repo and submit a pull request. Please ensure that the current tests pass before submitting a pull request.

License

MIT License

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

pyMALv2-0.0.3.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyMALv2-0.0.3-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file pyMALv2-0.0.3.tar.gz.

File metadata

  • Download URL: pyMALv2-0.0.3.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.0

File hashes

Hashes for pyMALv2-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a1371e86aec1db7cdf70d6582100832456795f1b864101a2cc3fbd8c53b2c0a1
MD5 5d7e047f19dcd44be2a4bfaba4ab57aa
BLAKE2b-256 d373ad7ed15dcd65807a8e001525551e8ba49ba2f1a0689febb6fce8fe1247a4

See more details on using hashes here.

File details

Details for the file pyMALv2-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyMALv2-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.0

File hashes

Hashes for pyMALv2-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6e8d82e3c35b0899e70476d4e1d04058f853c8de5326f2f57e0fd27e0bbcc38b
MD5 1d98d9831ea49188bec155efcc19eea3
BLAKE2b-256 27e1e7552c71231a2f8236b1d19e17f1bb3b9bd5b232b59e046d3b90f07347da

See more details on using hashes here.

Supported by

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