Simple read-only Anilist API wrapper
Project description
pyanilist
Simple read-only Anilist API wrapper
Table Of Contents
About
- Supports both sync and async.
- Read-only API wrapper.
- Only supports querying the
Media
type.
Installation
pyanilist
is available on PyPI, so you can simply use pip to install it.
pip install pyanilist
Usage
PyAnilist offers two main classes:
-
Anilist()
- Synchronous class-
search()
- Search a media>>> from pyanilist import Anilist, MediaType >>> media = Anilist().search("Attack on Titan", type=MediaType.ANIME) >>> media.title MediaTitle(romaji='Shingeki no Kyojin', english='Attack on Titan', native='進撃の巨人') >>> media.title.romaji 'Shingeki no Kyojin' >>> media.site_url Url('https://anilist.co/anime/16498') >>> media.episodes 25
-
get()
- Get a media by it's Anilist ID>>> from pyanilist import Anilist >>> media = Anilist().get(21459) >>> media.title MediaTitle(romaji='Boku no Hero Academia', english='My Hero Academia', native='僕のヒーローアカデミア') >>> media.title.english 'My Hero Academia' >>> media.site_url Url('https://anilist.co/anime/21459') >>> media.episodes 13
-
-
AsyncAnilist()
- Asynchronous class-
search()
- Search a media>>> import asyncio >>> from pyanilist import AsyncAnilist, MediaType >>> media = asyncio.run(AsyncAnilist().search("Attack on Titan", type=MediaType.ANIME)) >>> media.title MediaTitle(romaji='Shingeki no Kyojin', english='Attack on Titan', native='進撃の巨人') >>> media.title.romaji 'Shingeki no Kyojin' >>> media.site_url Url('https://anilist.co/anime/16498') >>> media.episodes 25
-
get()
- Get a media by it's Anilist ID>>> import asyncio >>> from pyanilist import AsyncAnilist >>> media = asyncio.run(AsyncAnilist().get(21459)) >>> media.title MediaTitle(romaji='Boku no Hero Academia', english='My Hero Academia', native='僕のヒーローアカデミア') >>> media.title.english 'My Hero Academia' >>> media.site_url Url('https://anilist.co/anime/21459') >>> media.episodes 13
-
API Reference
Checkout the complete API reference here.
License
Distributed under the Unlicense License. See UNLICENSE for more information.
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
pyanilist-0.2.0.tar.gz
(14.9 kB
view hashes)
Built Distribution
pyanilist-0.2.0-py3-none-any.whl
(18.5 kB
view hashes)
Close
Hashes for pyanilist-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc5d305880a36120cde571d00a8593fc7d720ea9f9b4aaa1e5fbd786c9d4540f |
|
MD5 | 890572c8972bce3982f2764a4cc413ff |
|
BLAKE2b-256 | 00be11fae774af898c49f2c26de35536748ce4f7880e6546af40ff2a206cf590 |