A simple python async wrapper for the Kitsu.io API.
Project description
kitsu-wrapper
A simple python async wrapper for the Kitsu.io API.
Supports searches for Animes, Mangas and Streaming Links.
Installation
NOTE: Python 3.6 or higher is required.
# Windows
py -3.6 -m pip install kitsu-wrapper
# Linux
python3.6 -m pip install kitsu-wrapper
Example
import asyncio
import kitsu
client = kitsu.Client()
async def anime_search(query):
entries = await client.search('anime', query, limit=5)
if not entries:
print(f'No entries found for "{query}"')
return
for i, anime in enumerate(entries, 1):
print(f'\n{i}. {anime.title}:')
print('---> Sub-Type:', anime.subtype)
print('---> Status:', anime.status)
print('---> Synopsis:\n' + anime.synopsis)
print('---> Episodes:', anime.episode_count)
print('---> Age Rating:', anime.age_rating_guide)
print('---> Ranking:')
print('-> Popularity:', anime.popularity_rank)
print('-> Rating:', anime.rating_rank)
if anime.started_at:
print('---> Started At:', anime.started_at.strftime('%Y-%m-%d'))
if anime.ended_at:
print('---> Ended At:', anime.ended_at.strftime('%Y-%m-%d'))
streaming_links = await client.fetch_anime_streaming_links(anime)
if streaming_links:
print('---> Streaming Links:')
for link in streaming_links:
print(f'-> {link.title}: {link.url}')
print('---> Kitsu Page:', anime.url)
async def manga_search(query):
entries = await client.search('manga', query, limit=5)
if not entries:
print(f'No entries found for "{query}"')
return
for i, manga in enumerate(entries, 1):
print(f'\n{i}. {manga.title}:')
print('---> Sub-Type:', manga.subtype)
print('---> Status:', manga.status)
print('---> Volumes:', manga.volume_count)
print('---> Chapters:', manga.chapter_count)
print('---> Synopsis:\n' + manga.synopsis)
print('---> Age Rating:', manga.age_rating_guide)
print('---> Ranking:')
print('-> Popularity:', manga.popularity_rank)
print('-> Rating:', manga.rating_rank)
if manga.started_at:
print('---> Started At:', manga.started_at.strftime('%Y-%m-%d'))
if manga.ended_at:
print('---> Ended At:', manga.ended_at.strftime('%Y-%m-%d'))
print('---> Kitsu Page:', manga.url)
loop = asyncio.get_event_loop()
loop.run_until_complete(anime_search(input('Insert an anime name: ')))
loop.run_until_complete(manga_search(input('Insert a manga name: ')))
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
kitsu-wrapper-1.0.0.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for kitsu_wrapper-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c42127693ceb6dc880e08a441f53e463a70546150d714e1af37523e64c7537c1 |
|
MD5 | 1bd999fa7c2d3cedc7bc74e3c8ebb8a9 |
|
BLAKE2b-256 | eeeaadbf2aa66f99f90828eb537a1877474536472cd27a0ee74ce5e880d1b2e9 |