Personal Library Manager
π About the Project
The Personal Library Manager is a command-line application that allows users to manage their personal book collection. With this tool, users can add, remove, search, and display books while also tracking their reading progress. The library data is saved persistently using JSON file handling to ensure that books remain stored even after the program is closed.
π Features
β Add a book: Users can add new books by entering the title, author, publication year, genre, and read status.
ποΈ Remove a book: Users can remove a book from the library, with a confirmation step for unread books.
π Search for books: Books can be searched by title or author.
π Display all books: Shows all books stored in the library along with details such as author, publication year, genre, and read status.
π View library statistics: Displays the total number of books and the percentage of books read.
πͺ Persistent storage: Uses JSON file handling to save and load books from a file (library.txt).
π Project Structure
|-- library.txt # JSON file storing the book data |-- library_manager.py # Python script for managing the library
π How to Run the Project
Prerequisites
Install Python 3.x on your system.
Running the Program
Clone the repository:
git clone https://github.com/your-username/personal-library-manager.git cd personal-library-manager
Run the script:
python library_manager.py
π How It Works
The program loads the existing book data from library.txt.
The user is presented with a menu to choose an action.
The selected operation is performed (adding, removing, searching, displaying books, or viewing statistics).
The updated library is saved back to library.txt before exiting.
πΎ Data Storage
The library data is stored in library.txt using JSON format.
Each book entry has the following structure:
[ { "title": "Book Title", "author": "Author Name", "publication_year": 2024, "genre": "Fiction", "read_status": true } ]
π― Example Usage
π Welcome to your Personal Library Manager! 1οΈβ£ β Add a book 2οΈβ£ ποΈ Remove a book 3οΈβ£ π Search for a book 4οΈβ£ π Display all books 5οΈβ£ π Display statistics 6οΈβ£ πͺ Exit and Save Enter your choice (1-6): 1 Enter book name: The Alchemist Enter writer name: Paulo Coelho Enter publication year: 1988 Enter genre: Fiction Have you read it? (yes/no): yes
β Book added successfully!
π Technologies Used
Python (for implementing the functionality)
JSON (for storing and retrieving data persistently)
π Future Enhancements
Add a feature to update book details.
Implement a category-wise listing of books.
Create a graphical user interface (GUI) using Tkinter or PyQt.
Export book lists to a CSV file.
π€ Contributing
If you'd like to contribute:
Fork the repository.
Create a new branch (git checkout -b feature-branch).
Commit your changes (git commit -m "Add new feature").
Push to the branch (git push origin feature-branch).
Open a pull request.
π Contact
If you have any questions, feel free to reach out via GitHub Issues!
Happy coding! ππ