- In this project, we want you to write a library program using the Python information you have learned so far, error catching - file operations, especially the Json module and file information.
- In a library; There are two main parts: Membership transactions and Book transactions.
- Membership transactions include information on adding a member, deleting a member, checking a member, giving a book to a member, and receiving a returned book from a member. A database or file where membership data is recorded is also required.
- We can say similar things about book transactions.
- It will consist of main.py, Kitap_transactions.py, Member_Transactions.py, Zaman.py files.
- The main file of our project will be the main.py file. Operations will be executed from this file, other Python files will be called from this section as a module. For example, adding a book, deleting a book, adding a member, giving a book to a member, and member control will be done here. This project is a beginner-friendly book management system built with Python. It allows users to manage a collection of books through a simple command-line interface. All data is stored in a JSON file for persistence.
- Add a book (interactive input for each field)
- Remove a book (by title)
- Update book details
- Search for a book (by title)
- List all books
- Below you will see a run output of this project. You can run the functions in the book_transactions and membership_transactions modules via inputs on the main page.
Each book is stored in the following format inside the books.json file:
{
"title": "1984",
"author": "George Orwell",
"year": 1949,
"genre": "Dystopian"
}- In this module, you will write book information (registered books and total number), add, delete, search and update functions. We will save our data in the book.json file. The Kitap.json file will be given to you (you can create it yourself if you wish). File control must be done with the Os Module. Below you can find function examples for book transactions, but you do not have to follow them, you can make your own planning.
- Python 3.x
- JSON module (built-in)
mini_book_system.py # Main script
books.json # Data file storing all books
- There is a lot of data in the Kitap.json file. We will work with the following data. We will use these as basis when adding new data or searching.
- Make sure Python 3 is installed.
- Clone the repository:
git clone https://github.com/yourUsername/mini_book_system.git
- Run the script:
python mini_book_system.py
sample output is as follows When you run the program, you'll be presented with a menu:
1. Add a book
2. Remove a book
3. Update a book
4. Search for a book
5. List all books
6. Exit
- Here, operations such as member information (member names and total number of members), member updating, adding members, searching for members, deleting members, lending books and returning books will be performed. Additionally, members must be saved in the uye.Json file. When lending a book, it is absolutely
-
- The date and time the book was lent and the date to return it after 2 weeks should be added and this information should be saved in the taksi.json file. You will be prompted to enter each field one by one:
Enter book title:
Enter author name:
Enter publication year:
Enter genre:
The book will be saved in books.json.
- We will do this from the py module when we create it ourselves.
-
- After being saved in the taksi.json file, the loaned book should be deleted from Kitap.json so that it does not appear when someone else wants to buy it.
You will be asked to enter the title of the book to remove. If found, it will be deleted from the JSON file.
- The data you will save to Uye.json should be as follows: You can update any field of a book by entering its title and then choosing which field to modify.
Search by title. If found, the book's details will be displayed.
- We lend our books to our members for 2 weeks. Therefore, we will record the time and date of the loan and the date when it should be returned, thanks to this module. When we run this module, we want it to return the current time and the time 2 weeks later.
Displays all books currently stored in the JSON file.
This project is ideal for Python learners who want to practice:
- File handling with JSON
- User input and validation
- Basic CRUD operations
- Modular and interactive programming
Feel free to fork the project and submit pull requests to improve functionality or add new features!
- Diagonal Difference: https://www.hackerrank.com/challenges/diagonal-difference/problem






