Skip to main content

A library to use the MyAnimeList API more easily.

Project description

myanimelistpy

myanimelistpy icon

A library to use the MyAnimeList API more easily.

Installing

pip install myanimelistpy

or

# Linux/macOS
python3 -m pip install -U myanimelistpy

# Windows
py -m pip install -U myanimelistpy

Examples

Anime List

Basic example:
from myanimelistpy.myanimelist import MyAnimeList

CLIENT_ID = "YOUR_MY_ANIME_LIST_CLIENT_ID"

if __name__ == "__main__":
    my_anime_list = MyAnimeList(client_id=CLIENT_ID)

    anime_list = my_anime_list.getAnimeList(
        anime_name = "Hunter x Hunter",
        limit      = 4
    )

    for anime in anime_list:
        print(f"Id: {anime.getId()}")
        print(f"Title: {anime.getTitle()}")
        print(f"Main Picture (medium): {anime.getMainPicture().getMedium()}\n")

Output

Id: 11061
Title: Hunter x Hunter (2011)
Main Picture (medium): https://api-cdn.myanimelist.net/images/anime/1337/99013.jpg

Id: 136
Title: Hunter x Hunter
Main Picture (medium): https://api-cdn.myanimelist.net/images/anime/8/19473.jpg
Request with fields:
from myanimelistpy.myanimelist import MyAnimeList

CLIENT_ID = "YOUR_MY_ANIME_LIST_CLIENT_ID"

if __name__ == "__main__":
    my_anime_list = MyAnimeList(client_id=CLIENT_ID)

    anime_list = my_anime_list.getAnimeList(
        anime_name = "Hunter x Hunter",
        limit      = 2,
        fields     = ["rank", "status"]
    )

    for anime in anime_list:
        print(f"Id: {anime.getId()}")
        print(f"Title: {anime.getTitle()}")
        print(f"Main Picture (medium): {anime.getMainPicture().getMedium()}")
        print(f"Rank: {anime.getRank()}")
        print(f"Status: {anime.getStatus()}\n")

Output

Id: 11061
Title: Hunter x Hunter (2011)
Main Picture (medium): https://api-cdn.myanimelist.net/images/anime/1337/99013.jpg
Rank: 9
Status: Finished airing

Id: 136
Title: Hunter x Hunter
Main Picture (medium): https://api-cdn.myanimelist.net/images/anime/8/19473.jpg   
Rank: 165
Status: Finished airing

Creator

Allan Capistrano
Allan Capistrano

How to find me:

Github icon   Linkedin icon   Email icon


Support

Please star this repository if this project is useful or helped you.

"Buy Me A Coffee"


License

GPL-3.0 License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

myanimelistpy-0.1.2-py3-none-any.whl (29.1 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