My Anime List Api Client and Auth.
Project description
MalApi
Instructions
- Create an app at https://myanimelist.net/apiconfig (May want to use http://localhost:8000/callback)
- Place the MAL_CLIENT_ID, MAL_CLIENT_SECRECT and MAL_REDIRECT_URI in the .env file (Refer .env.safe).
Example
#!/bin/env python3
from pprint import pprint
from pathlib import Path
from mal_api.client import Client
from mal_api.auth import Auth
MAL_CLIENT_ID = "MAL_CLIENT_ID"
MAL_CLIENT_SECRET = "MAL_CLIENT_SECRECT"
MAL_REDIRECT_URI = "http://127.0.0.1:8000/callback"
def main():
if not MAL_CLIENT_ID or not MAL_CLIENT_SECRET or not MAL_REDIRECT_URI:
raise Exception("Environment Variables not loaded")
auth = Auth(
clientId=MAL_CLIENT_ID,
clientSecret=MAL_CLIENT_SECRET,
redirectUri=MAL_REDIRECT_URI,
cacheFile=Path.joinpath(Path.home(), ".cache/malCache.json"),
)
auth.authenticate()
client = Client(auth=auth)
pprint(client.getUserData())
pprint(client.getUserAnimeList())
if __name__ == "__main__":
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
myanimelist-api-0.1.3.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for myanimelist_api-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68f594fc3a7c13ce9d6c04dac41403991d4c04eaefd738aeaf2b4d04403fea22 |
|
MD5 | de988f1d9510282840ff80a3c9bc4d2c |
|
BLAKE2b-256 | 1ae5b8d599f294efb59f859f6b05705983943bf63b9e318a817e17b24629d3df |