mal package

Submodules

mal.api module

class mal.api.MyAnimeList(username, password, date_format='%Y-%m-%d')[source]

Bases: object

Does all the actual communicating with the MAL api.

base_url = 'https://myanimelist.net/api'
find(regex, status='all', extra=False, user=None)[source]
list(status='all', type='anime', extra=False, stats=False, user=None)[source]
classmethod login(config)[source]

Create an instante of MyAnimeList and log it in.

search(query)[source]
status_codes = {'completed': 2, 'dropped': 4, 'on hold': 3, 'plan to watch': 6, 'rewatching': 7, 'watching': 1}
status_names = {1: 'watching', 2: 'completed', 3: 'on hold', 4: 'dropped', 6: 'plan to watch', 7: 'rewatching'}
update(item_id, entry, action='update')[source]
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36'
validate_login()[source]

mal.cli module

mal.cli.create_parser()[source]
mal.cli.main()[source]

mal.color module

mal.color.procedure_color(increment)[source]

Choose output color when incrementing/decrementing.

mal.color.score_color(score)[source]

Choose color of output based on how high the score is.

mal.commands module

These function serve as an entry point for the several subcommands of mal. All they do is basically call the functions that do actual work in the core module.

mal.commands.add(mal, args)[source]

Add an anime with a certain status to the list.

mal.commands.config(mal, args)[source]
mal.commands.decrease(mal, args)[source]
mal.commands.drop(mal, args)[source]

Drop a anime from lists based in a regex expression

mal.commands.edit(mal, args)[source]

Edit an entry in the users list, if it was present. Notify otherwise.

mal.commands.filter(mal, args)[source]

Search and find an anime in the users list.

mal.commands.increase(mal, args)[source]
mal.commands.list(mal, args)[source]

Show all the animes on the users list.

mal.commands.login(mal, args)[source]

Creates login credentials so that next time the program is called it can log in right at the start without any problem.

mal.commands.search(mal, args)[source]

Search MAL (not just the user) anime database.

mal.commands.stats(mal, args)[source]

Show the users anime watching statistics as presented on MAL.

mal.core module

mal.core.add(mal, regex, status='plan to watch')[source]

Add an entry to the user list.

mal.core.anime_pprint(index, item, extra=False)[source]

Pretty print an anime’s information.

mal.core.drop(mal, regex)[source]

Drop a anime based a regex expression

mal.core.edit(mal, regex, changes)[source]

Select and change entry. Opens file with data to change if no field was given.

mal.core.find(mal, regex, filtering='all', extra=False, user=None)[source]

Find all anime in a certain status given a regex.

mal.core.progress_update(mal, regex, inc)[source]
mal.core.remove_completed(items)[source]
mal.core.report_if_fails(response)[source]
mal.core.search(mal, regex, full=False)[source]

Search the MAL database for an anime.

mal.core.select_item(items)[source]

Select a single item from a list of results.

mal.core.start_end(entry, episode, total_episodes)[source]

Fill details of anime if user just started it or finished it.

mal.core.stats(mal, username=None)[source]

Print user anime stats.

mal.login module

mal.login.create_credentials()[source]
mal.login.get_credentials()[source]

Fetch the username and password from the right file.

mal.utils module

mal.utils.checked_connection(func)[source]

Wrap the function in a try/except to catch and handle a ConnectionError.

mal.utils.checked_regex(func)[source]

Wrap the function in a try/except to catch and handle a BadRegexError.

mal.utils.killed()[source]

Show a message if user terminated the program.

mal.utils.print_error(error_name, status, reason, kill=False)[source]

Module contents