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.4.tar.gz
(8.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file myanimelist_api-0.1.4.tar.gz.
File metadata
- Download URL: myanimelist_api-0.1.4.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d89083a06971ec044616be326051d49bacb4e815a0d1b095248a090079488638
|
|
| MD5 |
e9c67faef08c0dd61bcf952c1fca6c7f
|
|
| BLAKE2b-256 |
671f2b03c8457bfef42ef041ca9754b1e3d6e34ffc22aac54cc5e3d17c1ca6a5
|
File details
Details for the file myanimelist_api-0.1.4-py3-none-any.whl.
File metadata
- Download URL: myanimelist_api-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7acd70398b58af4bc7b5b2a8a00a919d89d8b1a865e9b84a4652f3320af9cf07
|
|
| MD5 |
1ff54d11c25a06cc562defc216211bcd
|
|
| BLAKE2b-256 |
b44a230a0b0ca9641ed13f05b57d9d60145d4922e347d524ed2762f9427a7e1d
|