By Sean Daniel Munene
The Anime Tracker CLI Application is a command-line interface tool that allows users to manage their anime watchlist. Built with Python and SQLAlchemy, the app lets users add, list, and organize anime, associate them with tags, and manage users, making it a perfect solution for anime enthusiasts who want to track their watching habits.
- User Management:
- Add and manage users.
- Anime Management:
- Add anime with details like title, genre, total episodes, and associated users.
- List all anime in the database.
- Tag Management:
- Add tags to anime for better categorization.
- Database Management:
- Automatically creates SQLite database tables.
To run the Anime Tracker app, ensure you have the following installed:
- Python 3.8+
pip(Python package installer)- The following Python libraries:
ClickSQLAlchemy
-
Clone the repository:
git clone https://github.com/sean810/anime-tracker cd anime-tracker -
Create and activate a virtual environment.
-
Install dependencies:
pip install -r requirements.txt
-
Initialize the database:
python -m lib.cli create_db_command
To interact with the Anime Tracker app, use the CLI commands which will be provided to you once you do:
python -m lib.cli or python lib/cli.pyAdd a new user to the database.
Example: add-user "username"Example:
Example: add-user "Sean"Add a new anime to the database, associating it with a specific user.
python -m lib.cli add-anime "title" "genre" total_episodes --user_id USER_IDExample:
Example: add-anime "Naruto" "Action" 500 --user_id 1Add a tag to an anime.
Example: add-tag ANIME_ID "tag_name"Example:
Example: add-tag 1 "Action"View a list of all anime in the database.
Example: list-animesExample output:
1: Naruto - Action (500 episodes)
2: One Piece - Adventure (1000 episodes)
One can delete a specific anime from the database by using it's ID
Example: delete-anime 1One can delete a specific user from the database by using it's ID
Example: delete-user 1One can delete a tag from the database by using it's ID
Example: delete-tag 1If you need any assistance while in the command line, type in;
--helpIf you want to exit the loop type in;
exitanime-tracker/
|— lib/
|— __init__.py
|— cli.py # CLI commands for interacting with the app
|— database.py # Database setup
|— models/
|— __init__.py
|— anime.py # Anime model
|— tag.py # Tag model
|— user.py # User model
|— requirements.txt # Python dependencies
|— .gitignore
|— README.md # Project documentation (this file)
-
Database:
- The app uses SQLite as its database.
- Models (User, Anime, and Tag) are defined using SQLAlchemy's ORM.
- A one-to-many relationship is established between Users and Anime.
- A many-to-many relationship is established between Anime and Tags.
-
CLI Commands:
- Built using the
Clicklibrary. - Each command interacts with the database via SQLAlchemy sessions.
- Built using the
-
User Workflow:
- Users should be added first.
- Anime are added and associated with a user.
- Tags can be applied to anime for categorization.
- Implement search functionality to find anime by title or tags.
- Add functionality to update anime details (e.g., completed episodes).
- Add a feature to delete anime, users, or tags.
- Enhance error handling and validation.
This project is licensed under the MIT License.
The Anime Tracker CLI Application utilizes the following technologies:
Python: The primary programming language for building the application. Click: A Python library for creating a user-friendly command-line interface. SQLAlchemy: An Object-Relational Mapping (ORM) library for database interaction. SQLite: A lightweight, file-based relational database for data storage. Virtual Environment: Ensures isolated dependency management for the project.
Special thanks to [Madam Beatrice Wambui] for guidance and support.