Skip to main content

Simple AniList API wrapper to fetch media data

Project description


Logo

Simple AniList API wrapper to fetch media data

PyPI - Version PyPI - Python Version GitHub Workflow Status (with event) GitHub Actions Workflow Status License Checked with mypy Ruff

Table Of Contents

About

  • Supports both sync and async.
  • Provides easy access to almost every field present in AniList's Media type.
  • 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

  1. AniList() - Synchronous class

    • search() - Search a media

      from pyanilist import AniList, MediaType
      
      media = AniList().search("Attack on Titan", type=MediaType.ANIME)
      
      print(media.title.romaji)
      """
      Shingeki no Kyojin
      """
      print(media.site_url)
      """
      https://anilist.co/anime/16498
      """
      print(media.episodes)
      """
      25
      """
      
    • get() - Get a media by it's AniList ID

      from pyanilist import AniList
      
      media = AniList().get(21459)
      
      print(media.title.english)
      """
      My Hero Academia
      """
      print(media.site_url)
      """
      https://anilist.co/anime/21459
      """
      print(media.episodes)
      """
      13
      """
      
  2. 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))
      
      print(media.title.romaji)
      """
      Shingeki no Kyojin
      """
      print(media.site_url)
      """
      https://anilist.co/anime/16498
      """
      print(media.episodes)
      """
      25
      """
      
    • get() - Get a media by it's AniList ID

      import asyncio
      from pyanilist import AsyncAniList
      
      media = asyncio.run(AsyncAniList().get(21459))
      
      print(media.title.english)
      """
      My Hero Academia
      """
      print(media.site_url)
      """
      https://anilist.co/anime/21459
      """
      print(media.episodes)
      """
      13
      """
      

Docs

Checkout the complete documentation here.

License

Distributed under the Unlicense License. See UNLICENSE for more information.

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

pyanilist-0.4.1.tar.gz (16.6 kB view hashes)

Uploaded Source

Built Distribution

pyanilist-0.4.1-py3-none-any.whl (20.8 kB view hashes)

Uploaded Python 3

Supported by

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