Video Demo: https://youtu.be/_zr8rmAvYV4?feature=shared
project.py
- main file of the applicationtest_project.py
- test file for project.pycompleted_books.json
- json file containing information about user's completed books. This file will be created when you rate a book and updated each time you add, update or delete a book.env
- optional file if you want to get recommendations from Chat GPT based on your completed booksrequirements.txt
- file with dependencies required to run this application
My project is a CLI that allows users to manage their book collection and provides them with following functionalities:
- Browsing books from Google Books API by author or title
- CRUD functionalities on user's book collection:
- Adding books to their collection by giving them a score
- Viewing books from their collection
- Updating scores of their completed books
- Deleting books from their collection
- Getting personalized book recommendations from Chat GPT based on user's completed books and given scores
Install requirements
pip install requirements.txt
Browse books
python project.py --title "book of the five rings"
View completed books
python project.py --completed
Create a .env
in file in project directory
touch .env
Set your Open AI API key as an environment variable
API_KEY="your key"
Get recommendations from Chat GPT
python project.py --recommend
Search books by title
--title TITLE, -t TITLE
Search books by author
--author AUTHOR, -a AUTHOR
View your completed books
--completed, -c
Get book recommendations based on your completed books list. Required OpenAi API KEY in .env
--recommend, -r
One of the main challenges was implementing the book recommendation feature. Initially, I considered recommending books based on the highest-rated ones in the user’s favorite categories. However, this approach was limited because not all books have average ratings or categories, and it lacked true personalization. It would mostly suggest popular books rather than those aligned with the user’s unique preferences.
To overcome this, I decided to use a Large Language Model like ChatGPT for generating recommendations. This approach was simple to implement: I send a POST request with the user’s completed books and receive personalized suggestions in return. ChatGPT’s ability to analyze reading patterns and preferences made it a much more powerful and flexible solution than relying solely on category-based recommendations.