A Python-based Library Management System that uses MySQL as its backend database to efficiently manage library records. The application supports adding, viewing, searching, issuing, returning, and deleting books while maintaining the availability of book copies through SQL queries.
- Add new books to the library
- View book details
- Search books using book number
- Issue books
- Return books
- Remove individual books
- Remove all books from the library
- Track available copies of each book
- Automatic database creation
- Automatic table creation
- Input validation
- Menu-driven console interface
- Python 3
- MySQL
- mysql-connector-python
- SQL
- Object-Oriented Programming (OOP)
library
records
| Column | Data Type | Description |
|---|---|---|
| Book_ID | INT | Primary Key (Auto Increment) |
| Book_Name | VARCHAR(30) | Unique Book Name |
| Author_Name | VARCHAR(30) | Author Name |
| Book_Number | INT | Unique Book Number |
| Total_Copies | INT | Total Copies Available |
| Available_Copies | INT | Copies Currently Available |
- CREATE DATABASE
- CREATE TABLE
- PRIMARY KEY
- AUTO_INCREMENT
- UNIQUE Constraints
- NOT NULL Constraints
- INSERT
- SELECT
- UPDATE
- DELETE
- WHERE Clause
- Parameterized Queries
BooksLibrary
Libraryinherits fromBooks
- Add Books
- View Books
- Search Books
- Issue Books
- Return Books
- Remove Books
Database operations are organized within class methods.
- Add Books
- View Books
- Remove Books
- Search using Book Number
- Issue Books
- Return Books
- Track Available Copies
- Insert Records
- Retrieve Records
- Update Records
- Delete Records
Library-Management-System-MySQL/
│
├── sql_connector.py # Creates database and table
├── library_management.py # Main application
├── README.md
Before running the project, make sure you have:
- Python 3.x
- MySQL Server
- mysql-connector-python package installed
Install the required package:
pip install mysql-connector-pythonThe application automatically:
- Creates the library database (if it does not exist).
- Creates the records table (if it does not exist).
No manual SQL setup is required before running the application.
- Clone the repository.
git clone https://github.com/Navin-Verma/library-management-system-mysql.git- Navigate to the project directory.
cd library-management-system-mysql- Update your MySQL credentials in
sql_connector.py.
host="localhost"
user="root"
password="your_password"- Run the application.
python library_management.pyThis project helped me strengthen my understanding of:
- Python Programming
- MySQL Database Management
- SQL CRUD Operations
- Object-Oriented Programming
- Database Connectivity using mysql-connector-python
- Parameterized SQL Queries
- Input Validation
- Menu-Driven Applications
- Tkinter GUI Interface
- User Authentication
- Student Borrowing Records
- Fine Calculation System
- Due Date Tracking
- Book Categories
- Database Backup & Restore
- Search by Author Name
- Dashboard and Reports
Navin Verma
GitHub: https://github.com/Navin-Verma
⭐ If you found this project useful, consider giving it a star on GitHub!