A peaceful and fully typed MyAnimeList/Jikan API wrapper with caching and proper rate limiting.
Project description
Anmoku 安黙
A peaceful and fully typed MyAnimeList / Jikan Python API wrapper with caching and proper rate limiting.
[!NOTE]
Anmoku is currently a work in progress so the features below may not be complete yet.
Features ✨
- Rate limiting 🎀 (with actual waiting).
- Supports caching. ⚡
- Fully type hinted. 🌌
yes you heard me correctly
Examples ⚗️
Anmoku is probably the simplest Jikan API wrapper you'll ever use. All you need is the client and the resource. 🌊
from anmoku import Anmoku, AnimeCharacters
client = Anmoku(debug = True)
anime_characters = client.get(AnimeCharacters, id = 28851) # ID for the anime film "A Silent Voice".
for character in anime_characters:
print(f"{character.name} ({character.url})")
client.close()
We also have an async client:
import asyncio
from anmoku import AsyncAnmoku, AnimeCharacters
async def main():
client = AsyncAnmoku(debug = True)
anime_characters = await client.get(AnimeCharacters, id = 28851) # ID for the anime film "A Silent Voice".
for character in anime_characters:
print(f"{character.name} ({character.url})")
await client.close()
asyncio.run(main())
Output:
[DEBUG] (anmoku) - [AsyncAnmoku] GET --> https://api.jikan.moe/v4/anime/28851/characters
Ishida, Shouya (https://myanimelist.net/character/80491/Shouya_Ishida)
Nishimiya, Shouko (https://myanimelist.net/character/80243/Shouko_Nishimiya)
Headteacher (https://myanimelist.net/character/214351/Headteacher)
Hirose, Keisuke (https://myanimelist.net/character/97569/Keisuke_Hirose)
Ishida, Maria (https://myanimelist.net/character/97943/Maria_Ishida)
Ishida, Sister (https://myanimelist.net/character/118723/Sister_Ishida)
# ... more characters below but I cut them off for the convenience of this readme
Searching! 🤩
Here are some searching examples you can try:
from anmoku import Anmoku, Character
client = Anmoku(debug = True)
characters = client.search(Character, "anya forger")
for character in characters:
print(f"{character.name} ({character.image.url})")
client.close()
Merge that with gradio and you have a GUI. https://github.com/THEGOLDENPRO/anmoku/blob/099f6596b685daa65259319d6730bef674ced38a/examples/gradio_anime_search.py#L1-L23
Type hinting support! 🌌
API responses in our library are strongly typed.
On top of that, we even provide class interfaces if you wish for stability and ease of use.
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
Built Distribution
File details
Details for the file anmoku-1.0.0.dev1.tar.gz
.
File metadata
- Download URL: anmoku-1.0.0.dev1.tar.gz
- Upload date:
- Size: 5.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9fb491763fac6f8700129ff6105a9d11250c17d6cc9c3800affcc29e1a6a944 |
|
MD5 | f9479f74a1cee02e00097964dd920513 |
|
BLAKE2b-256 | ebe6303f37f6904f2051b3b8f314fd2ea858324d57efbf4510884736e41b29e5 |
File details
Details for the file anmoku-1.0.0.dev1-py3-none-any.whl
.
File metadata
- Download URL: anmoku-1.0.0.dev1-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c302128aca3dad58f927d05131c3820fdf3c0059a93dd700c0105444d0de7cc |
|
MD5 | 8278e214ee810bd149dc2ca69f2b39c9 |
|
BLAKE2b-256 | 97bf6d8a663cb35cd599350de2cbf5ee2873cacbf30e10ca7f301e307450920c |