Welcome to mal.py’s documentation!
mal.py is an API wrapper for MyAnimeList.net written in Python.
Features:
anime and manga search given a keyword
fetch details of anime or manga given its id or its url
accessing public lists of users
retrieving seasonal anime
retrieve rankings for anime and manga
retrieve forum boards and discussions
Introduction
Start by installing the library on your system, the use of a virtual environment is recommended (see Virtual Environments and Packages):
install the library
$ pip install mal-api.py
obtain a token for the mal API
login on MAL
go to account settings -> API -> create id
follow the procedure and save your tokens
for this library you will need to use the client id
Now you can start using the library
from mal import client cli = client.Client('your token here') anime = cli.get_anime(16498) anime.title >> Shingeki_no_Kyojin
For more examples you can check the examples on the repository
Logging
This library uses the logging module to keep track of configuration changes and possible network errors. If you want to see the logs you need to configure the logging module yourself, for example:
import logging logging.basicConfig(logging.level=INFO)
For more information on how to use logging refer to the documentation of python:
Reporting issues
If you encounter issues using the library you can open an issue or start a discussion on the project repository. Please note that this is still a work in progress and there can be bugs. Also The API is not set and could change in later revisions. Breaking changes may happen at any time before the release of version 1.0 but i will try not to make them if not necessary.