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()
Metadata
Release files for myanimelist-api 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| myanimelist_api-0.1.4.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| myanimelist_api-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / myanimelist_api-0.1.4.tar.gz
| Download URL | myanimelist_api-0.1.4.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d89083a06971ec044616be326051d49bacb4e815a0d1b095248a090079488638
|
|
BLAKE2b-256 checksum How to use checksums |
671f2b03c8457bfef42ef041ca9754b1e3d6e34ffc22aac54cc5e3d17c1ca6a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / myanimelist_api-0.1.4-py3-none-any.whl
| Download URL | myanimelist_api-0.1.4-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7acd70398b58af4bc7b5b2a8a00a919d89d8b1a865e9b84a4652f3320af9cf07
|
|
BLAKE2b-256 checksum How to use checksums |
b44a230a0b0ca9641ed13f05b57d9d60145d4922e347d524ed2762f9427a7e1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|