Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Python Library Manager

A simple Python console app for tracking books. You can add, list, update, and delete books. This project is for beginners learning Python.

Features

  1. List books
  2. Add a new book
  3. Mark a book as read or unread
  4. Delete a book
  5. Exit

Functions

  • load_books — load books from the JSON file
  • save_books — save books to the JSON file
  • list_books — show all books
  • add_book — add a new book
  • change_status — change read / unread status
  • delete_book — delete a book
  • show_menu — show the menu
  • main — start the program

Technologies

  • Python 3
  • Standard library only (json)
  • UTF-8 file reading and writing

No third-party packages. No requirements.txt.

Files

python-library-manager/
├── book.py        # main app
├── README.md      # project info
├── .gitignore
└── books.json     # created after the first save

How to Run

python3 book.py

Menu

--- BOOK TRACKER ---
1. List Books
2. Add New Book
3. Mark Read/Unread
4. Delete Book
5. Exit
Your choice (1-5):

JSON Storage

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.

Error Handling

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

Manual Test Checklist

  • 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

Possible Later Features

  • Search by title or author
  • Sort books
  • Rating (1-5)
  • Book category
  • Show only unread books

About

A simple Python app for beginners. Track your books and save them in a JSON file.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages