Skip to main content

A simple python async wrapper for the Kitsu.io API.

Project description

Disco

Discord License Twitter

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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kitsu_wrapper-1.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file kitsu-wrapper-1.0.0.tar.gz.

File metadata

  • Download URL: kitsu-wrapper-1.0.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for kitsu-wrapper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 26cc95d62c6d54d232820b8ae4ef1e7dcfa19520d13921d636a4342eb715c7e3
MD5 4539f56b48dcf2bd00f15eb5121db88a
BLAKE2b-256 28326ec40a89df1c09b177ceb3f97788ee3379f75730aede6ec2a60b21ebfe8f

See more details on using hashes here.

File details

Details for the file kitsu_wrapper-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: kitsu_wrapper-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for kitsu_wrapper-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c42127693ceb6dc880e08a441f53e463a70546150d714e1af37523e64c7537c1
MD5 1bd999fa7c2d3cedc7bc74e3c8ebb8a9
BLAKE2b-256 eeeaadbf2aa66f99f90828eb537a1877474536472cd27a0ee74ce5e880d1b2e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page