A simple Python console app for tracking books. You can add, list, update, and delete books. This project is for beginners learning Python.
- List books
- Add a new book
- Mark a book as read or unread
- Delete a book
- Exit
load_books— load books from the JSON filesave_books— save books to the JSON filelist_books— show all booksadd_book— add a new bookchange_status— change read / unread statusdelete_book— delete a bookshow_menu— show the menumain— start the program
- Python 3
- Standard library only (
json) - UTF-8 file reading and writing
No third-party packages. No requirements.txt.
python-library-manager/
├── book.py # main app
├── README.md # project info
├── .gitignore
└── books.json # created after the first save
python3 book.py--- BOOK TRACKER ---
1. List Books
2. Add New Book
3. Mark Read/Unread
4. Delete Book
5. Exit
Your choice (1-5):
Books are saved in books.json:
{
"title": "Crime and Punishment",
"author": "Dostoevsky",
"read": false
}The file is created after the first successful change. Saved books stay after you close and open the app again.
The app does not crash if:
- the JSON file is missing or broken
- the menu choice is invalid
- the book number is not a number
- the book number is 0, negative, or too big
- the title or author is empty
- the book list is empty
- Start without
books.json - List books when empty
- Add a valid book
- Try empty title / empty author
- Change status to read, then unread
- Enter bad book numbers (letters, 0, negative, too big)
- Delete a book
- Try delete when empty
- Restart and check saved books
- Add special characters and check JSON
- Start with a broken JSON file
- Enter a menu choice outside 1-5
- Search by title or author
- Sort books
- Rating (1-5)
- Book category
- Show only unread books