Final Project for CS50P course Created by Jody Bailey YouTube video for final project
An anime list tracker and recommender command-line application written in Python. It allows users to view, add, update, and delete entries for their own anime list, as well as recommend new anime to watch
- Viewing current entries in their watch list
- Adding anime to their watch list by searching for the anime that matches the name provided
- Updating the status or score of the entries in their watch list
- Deleting watch list entries
- Getting a recommendation based on the criteria provided and the current entries in the watch list
It uses a single table in a SQLite database to hold all of the user's watch list entries. This database is created when you first run the application.
It utilizes Anilist's GraphQL API for getting information about the entries in the user's watch list, as well as getting a recommendation based on the input given to the GraphQL query. This API requires no authentication and can be called by simply sending a request to the URL (https://graphql.anilist.co), with the specified query and query variables to get anime based on that criteria.
Basic Usage:
python project.py <mode> <flags>
Example:
python project.py watchlist -l
Replace <mode>
with one of the valid modes and replace <flags>
with the appropriate flags available for each mode
watchlist
recommend
-l --list
: List the current entries in the watch list-a --add
: Add an entry into the watch list (multi-step process)-u --update
: Update an entry in the watch list (multi-step process)-d --delete
: Delete an entry in the watch list (multi-step process)
All flags that require a multi-step process will kick off an interactive terminal where you will provide input for the steps for completing the process. For example, if you provide the -a
flag, it will ask you to input the name of the anime, then call the GraphQL API with that name and provide you with the search results that best fit that name, and then ask you which anime fits the name of the anime that was provided. This will continue until the last step of the process is completed.
NB: Only one flag can be provided at a time for the watchlist
mode
-g --genres
: Genres that the anime should have (multiple values allowed)-ms --min-score
: Minimum score that the anime should have-me --max-episodes
: Maximum number of episodes that the anime can have-f --format
: Format of the anime (multiple values allowed)-s --status
: Status of the anime
All valid values for the genres
, format
, or status
flags are case-insensitive.
- Action
- Adventure
- Comedy
- Drama,
- Ecchi
- Fantasy,
- Horror
- Mahou Shoujo
- Mecha
- Music
- Mystery
- Psychological
- Romance
- Sci-Fi
- Slice of Life
- Sports
- Supernatural
- Thriller
NB Ensure that double quotes (""
) surround genres that contain multiple words. Example: python project.py recommend -g "Mahou Shoujo" Sci-Fi "Slice of Life"
- TV
- TV_SHORT
- MOVIE
- SPECIAL
- OVA
- ONA
- MUSIC
- FINISHED
- RELEASING
- NOT_YET_RELEASED
- CANCELLED
- HIATUS
- Create a Python virtual environment
python -m venv .venv
and activate the environmentsource .venv/bin/activate
(The version used for developing the project was Python 3.12.2) - Install dependencies
pip install -r requirements.txt
To start the SQLite DB interactive terminal for debugging, run sqlite3 anime.db
Contains the 2 GraphQL queries for getting a single anime and a list of anime, through pagination
All files/folders that should be ignored when pushing changes to github
All static string variables
Contains the core functionality of the application, that is:
- The
main
method for setting up the command-line arguments and flags - Several other methods for handling the core features, which are:
- Viewing the entries in the user's watch list
- Adding entries to the user's watch list
- Updating entries in the user's watch list
- Deleting entries in the user's watch list
- Recommending a unique anime based on the criteria given and the current entries in the user's watch list
All pip installable dependencies required for this project to run.
All SQL queries that are utiliZed to interact with the SQLite database.
All 5 test classes for testing the 5 core features of the application
Anilist GraphQL API Official Python documentation on the argparse library Official Python documentation on the unittestlibrary