Skip to content
Kevin L edited this page Feb 14, 2022 · 8 revisions

Welcome to the AnilistPython wiki!

alt text

example workflow downloads downloads licence Test

Version 0.1.1 Overview

This recent update for AnilistPython has resulted in a moderate change in the library's archetecture for increased efficiency and speed. Various features have also been added to the library. Listed below are some of the main additions and alterations made to the library.

New features:

  1. Anime search by genre, year, and/or average score (finally!)
  2. Offline anime retrieval support for anime - BETA
  3. Manga search support
  4. Auto setup feature that help new python programmers to setup required libraries automatically

Optimization and updates:

  1. The lib now has its own prebuild anime database!
  2. Anime, manga, and character search functions have all been optimized, making searches faster!
  3. Improved the deepsearch feature in .get_anime().
  4. Manually selecting results feature is now a parameter instead of a seperate function (see usage below).

How to use?

Step One: Library Installation

pip install AnilistPython==0.1.1

Step Two: Instance Creation

from AnilistPython import Anilist
anilist = Anilist()

Step Three: Usage

The AnilistPython library has been split into three distinct sections. Each section possess a different set of functions used for retrieving data in that category. Please visit the full documentation for more info or skip to the General Function Overview section for usage.

General Function Overview

The following functions are supported by AnilistPyhon version 0.1.1. Only the default parameter has been displayed below. For more information, visit the full documentation.

# ANIME
anilist.get_anime("Owari no Seraph")        # returns a dictionary containing info about owari no seraph
anilist.get_anime_with_id(126830)           # returns a dictionary with Code Geass (ID:126830) info 
anilist.get_anime_id("ReZero")              # returns Re:Zero's ID on Anilist
anilist.print_anime_info("Madoka Magica")   # prints all information regarding the anime Madoka Magica

# returns a list of anime with the given restrictions
anilist.search_anime(genre=['Action', 'Adventure', 'Drama'], year=[2016, 2019], score=range(80, 95))

#CHARACTER
anilist.get_character("Emilia")             # returns a dictionary containing the info about Emilia-tan 
anilist.get_character_with_id(13701)        # returns a dictionary with Misaka Mikoto (ID:13701) info
anilist.get_character_id("Milim")           # returns character Milim's ID on Anilist
anilist.print_anime_info("Kirito")          # prints all information regarding the character Kirito

# MANGA
anilist.get_manga("Seraph of the End")      # returns a dictionary containing info about seraph of the end
anilist.get_manga_with_id(113399)           # returns a dictionary with Tearmoon (ID:113399) info
anilist.get_manga_id("Tearmoon Empire")     # returns Tearmoon Empire's ID on Anilist (manga)
anilist.print_manga_info("Tensei Slime")    # prints all information regarding the manga Tensei Slime

Note: The feature for manully selecting the top three search results in the terminal is now controlled by a parameter (manual_select) in .get functions. For more information, please visit the full documentation. A sample program that has manual select enabled would be:

anilist.get_anime("Owari no Seraph", manual_select=True)

Anime Overview

The following functions are supported by AnilistPython version 0.1.1.

  • .get_anime() - search anime by name (online)
  • .get_anime_from_database() - search anime by name (offline - BETA)
  • .search_anime() - search anime by genre, year, and/or score
  • .get_anime_with_id() - search anime by ID
  • .get_anime_id() - get anime ID
  • .print_anime_info() - print anime information

Retrieve by name (online)

  • Function: .get_anime()

AnilistPython offers the ability to retrieve the anime information when given the name of the anime. The name of the anime does not have to be exactly accurate (the search engine will automatically resolve this).

from AnilistPython import Anilist
anilist = Anilist()

anime_dict = anilist.get_anime('Seraph of the End')

Manually Select Result: The function .get_anime() allows to user to select which of the top three search results should be retrieved. (manual_select is set to False by default)

anime_dict = anilist.get_anime('Seraph of the End', manual_select=True)

Deepsearch Feature: The function .get_anime() is currently supported by DeepSearch. DeepSearch is a built-in extension that helps AnilistPython to return more accurate search results. Although the DeepSearch module is favorable to use in most cases, it does, however, take around 15% more time to retrieve the information.

anime_dict = anilist.get_anime('Seraph of the End', deepsearch=True)

Retrieve by name (offline) - BETA

  • Function: .get_anime_from_database()

The use of this function is not advisable at its current state. This allows the user to retrieve anime with a given name offline from the local databases.

from AnilistPython import Anilist
anilist = Anilist()

anime_list = anilist.get_anime_from_database('Seraph of the End')

The anime_list will contain all the close search results for the anime named "seraph of the end".

Note: this feature is currently in BETA testing and does not guarantee accurate and efficient searches. The first search of an anime will generally take some time, but the results will be automatically cached. The second search for the same anime will be much faster thanks to the cache design of the database system.


Retrieve by genre, year, score

  • Function: .search_anime()

AnilistPython version 0.1.1 has initialized support for anime search given the genre, year, and/or score of the anime.

from AnilistPython import Anilist
anilist = Anilist()

ani_list = anilist.search_anime(genre=['Action', 'Adventure', 'Drama'], year=['2016', '2019'], score=range(80, 95))

ani_list_2 = anilist.search_anime(genre='action', year='2016', score=80)

The ani_list will contain a list of dictionaries with anime data given the following restrictions:

  • Genre must contain: Action, Adventure, and Drama
  • Year must be from: 2016 or 2019
  • Score must range from: 80 to 95

To only retrieve the IDs, set id_only to True.

ani_list_2 = anilist.search_anime(genre='action', year='2016', score=80, id_only=True)

Retrieve by ID

  • Function: .get_anime_with_id()

AnilistPython can also retrieve anime data given the ID of the anime from Anilist.co

from AnilistPython import Anilist
anilist = Anilist()

anime_dict = anilist.get_anime_with_id(126830) #Code Geass

Get Anime ID

  • Function: .get_anime_id()

The AnilistPython library also allows the user to retrieve anime ID from Anilist.co.

from AnilistPython import Anilist
anilist = Anilist()

anilist.get_anime_id('no game no life')

This will return the anime ID of No Game No Life formatted as an int from Anilist.


Print Anime Info

  • Function: .print_anime_info()

This feature automatically formats the data retrieved from the anime and displays this information in the terminal.

from AnilistPython import Anilist
anilist = Anilist()

anilist.print_anime_info('no game no life')

Sample Output

=========================================== ANIME INFO ===========================================
Name(romaji): No Game No Life
Name(Eng): No Game, No Life
Started Airing On: 4/9/2014
Ended On: 6/25/2014
Cover Image: https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/nx19815-bIo51RMWWhLv.jpg
Banner Image: https://s4.anilist.co/file/anilistcdn/media/anime/banner/19815.jpg
Airing Format: TV
Airing Status: FINISHED
Total Ep Count: 12
Season: SPRING
Description: <removed in the documentation>
(Source: Anime News Network)
Ave. Score: 78
Genres: ['Adventure', 'Comedy', 'Ecchi', 'Fantasy']
Next Ep Airing Date: None

Character Overview

The following functions are supported by AnilistPython version 0.1.1.

  • .get_character() - search character by name
  • .get_character_with_id() - search character by ID
  • .get_character_id() - get character ID
  • .print_anime_info() - print character information

Retrieve by name

  • Function: .get_character()

AnilistPython offers the ability to retrieve the character information when given the name of the character. The name of the character does not have to be exactly accurate (the search engine will automatically resolve this).

from AnilistPython import Anilist
anilist = Anilist()

## returns a dictionary containing the info about Emilia-tan 
anime_dict = anilist.get_character("Emilia") 

Manually Select Result: The function .get_character() allows to user to select which of the top three search results should be retrieved. (manual_select is set to False by default)

anime_dict = anilist.get_character("Emilia", manual_select=True)

Retrieve by ID

  • Function: .get_character_with_id()

AnilistPython can also retrieve character data given the ID of the anime from Anilist.co

from AnilistPython import Anilist
anilist = Anilist()

***

## returns a dictionary containing the info about Misaka Mikoto (ID:13701) from Railgun
anime_dict = anilist.get_character_with_id(13701) 

Get Character ID

  • Function: .get_character_id() The AnilistPython library also allows the user to retrieve character ID from Anilist.co.
from AnilistPython import Anilist
anilist = Anilist()

## returns character Milim's ID on Anilist
anilist.get_character_id('Milim')

Print Character Info

  • Function: .print_anime_info() This feature automatically formats the data retrieved from the anime and displays this information in the terminal.
from AnilistPython import Anilist
anilist = Anilist()

anilist.print_character_info("Kirito")

Sample Output

=========================================== CHARACTER INFO ===========================================
First Name: Kazuto
Last Name: Kirigaya
Japanese Name: 桐ヶ谷和人
Description: 
Height: 172 cm
Weapon(s) of choice: Anneal Blade (1st Level), Queen's Knightblade (9th Level), Elucidator (50th level) and Dark Repulser (forged by Lisbeth)
Kirito is the main protagonist of the series. He is a "solo" player, a player who hasn't joined a guild and usually works alone. He is also one of the ... 
Image: https://s4.anilist.co/file/anilistcdn/character/large/b36765-BnLbXg0Tzzh9.png

Manga Overview

The following functions are supported by AnilistPython version 0.1.1.

  • .get_manga() - search manga by name
  • .get_manga_with_id() - search manga by ID
  • .get_manga_id() - get manga ID
  • .print_manga_info() - print manga information

Retrieve by name

  • Function: .get_manga()

AnilistPython offers the ability to retrieve the manga information when given the name of the manga. The name of the manga does not have to be exactly accurate (the search engine will automatically resolve this).

from AnilistPython import Anilist
anilist = Anilist()

## returns a dictionary containing the info about Emilia-tan 
anime_dict = anilist.get_manga("Solo Leveling") 

Manually Select Result: The function .get_manga() allows to user to select which of the top three search results should be retrieved. (manual_select is set to False by default)

anime_dict = anilist.get_manga("Solo Leveling", manual_select=True)

Retrieve by ID

  • Function: .get_manga_with_id()

AnilistPython can also retrieve manga data given the ID of the anime from Anilist.co

from AnilistPython import Anilist
anilist = Anilist()

## returns a dictionary containing the info about the manga Tearmoon Empire (ID:113399)
anime_dict = anilist.get_manga_with_id(113399) 

Get Manga ID

  • Function: .get_manga_id() The AnilistPython library also allows the user to retrieve manga ID from Anilist.co.
from AnilistPython import Anilist
anilist = Anilist()

## returns Manga Eighty-Six's ID on Anilist
anilist.get_manga_id('eighty six')

Print Manga Info

  • Function: .print_manga_info() This feature automatically formats the data retrieved from the anime and displays this information in the terminal.
from AnilistPython import Anilist
anilist = Anilist()

anilist.print_manga_info("Kirito")

Sample Output

=========================================== MANGA INFO ===========================================
name_romaji: Tearmoon Teikoku Monogatari: Dantoudai kara Hajimaru, Hime no Tensei Gyakuten Story
name_english: Tearmoon Empire
starting_time: 6/1/2019
ending_time: None/None/None
cover_image: https://s4.anilist.co/file/anilistcdn/media/manga/cover/medium/bx113399-ar4LiUOEoxRn.jpg
banner_image: https://s4.anilist.co/file/anilistcdn/media/manga/banner/113399-K1GJJeyJ2q8o.jpg
release_format: NOVEL
release_status: RELEASING
chapters: None
volumes: None
desc: Surrounded by the hate-filled gazes of her people, the selfish princess of the fallen...
(Source: J-Novel Club, edited)
average_score: 63
mean_score: 78
genres: ['Drama', 'Fantasy', 'Romance']
Clone this wiki locally