-
Notifications
You must be signed in to change notification settings - Fork 19
Home
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:
- Anime search by genre, year, and/or average score (finally!)
- Offline anime retrieval support for anime - BETA
- Manga search support
- Auto setup feature that help new python programmers to setup required libraries automatically
Optimization and updates:
- The lib now has its own prebuild anime database!
- Anime, manga, and character search functions have all been optimized, making searches faster!
- Improved the deepsearch feature in
.get_anime()
. - Manually selecting results feature is now a parameter instead of a seperate function (see usage below).
Step One: Library Installation
pip install AnilistPython==0.1.2
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.
- Anime - (Documentation)
- Manga - (Documentation)
- Character - (Documentation)
The following functions are supported by AnilistPyhon version 0.1.2. 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)
The following functions are supported by AnilistPython version 0.1.2.
-
☆
.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
- 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)
- 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.
- Function:
.search_anime()
AnilistPython version 0.1.2 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)
- 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
- 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.
- 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
The following functions are supported by AnilistPython version 0.1.2.
-
.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
- 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)
- 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)
- 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')
- 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
The following functions are supported by AnilistPython version 0.1.2.
-
.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
- 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)
- 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)
- 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')
- 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']
Kevin L. (ReZeroK)