A simple Command-Line Library Management System built using Python and MySQL.
This project helps manage books and members in a library with issue/return log features — all through a terminal interface.
- Add / Delete / Update books and members
- Display all books and members
- Search books by ID or Name
- Sort books by ID or Name
- Issue and Return books
- View complete register/logs (issue/return history)
- Python 3.x
- MySQL Server (running on
localhost) - MySQL Database:
library - Python Package:
pip install mysql-connector-python
- OS: Windows only (uses
os.system('cls')for screen clearing)
CREATE TABLE book (
id INT PRIMARY KEY,
name VARCHAR(100),
author VARCHAR(100),
publisher VARCHAR(100),
qty INT
);CREATE TABLE member (
id INT PRIMARY KEY,
name VARCHAR(100),
phone VARCHAR(15)
);CREATE TABLE register (
book_id INT,
book_name VARCHAR(100),
member_id INT,
member_name VARCHAR(100),
date DATE,
action VARCHAR(20)
);- Start MySQL server and ensure the
librarydatabase with tables is created - Clone this repository:
git clone https://github.com/rajdeep-das-2007/Library_Management_System_Python.git cd Library_Management_System_Python - Run the script:
python library_management.py
- Use the terminal interface to manage the library
- Works only on Windows OS due to usage of
clscommand for screen clearing - Ensure correct MySQL credentials and database name in the script
- No GUI — pure terminal-based interaction
- All data is stored directly in MySQL tables
Register a new book with the following details:
- Book No.
- Book Name
- Author Name
- Price
- Quantity (Number of Copies)
Add a new library member by entering:
- Member No.
- Member Name
- Mobile Number
Issue a book to a member with:
- Issue No.
- Book No.
- Member No.
- Due Date
Get complete details of a book issued using the Issue Number.
Display a list of all books available in the library.
Display a list of all registered library members.
See all books currently issued to members.
Modify or update library data:
- Extend Due Date of issued book
- Cancel a Membership
Return a book using the corresponding Issue Number.
Exit the application safely.
This is a special admin-only feature used to delete or reset the library database.
- Option 1 – Deletes all records from the
booktable. - Option 2 – Deletes all records from the
membertable. - Option 3 – Deletes all entries from the
register(issued books) table. - Option 4 – Deletes everything from
book,member, andregistertables. - Option 0 – Cancels the operation.
