Skip to content

About

A complete Library Management System built with Python and MySQL, demonstrating CRUD operations, SQL integration, and database management.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

Python Database Connector Project Type Status

LIBRARY MANAGEMENT SYSTEM (MySQL)

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.


Features

  • 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

Technologies Used

  • Python 3
  • MySQL
  • mysql-connector-python
  • SQL
  • Object-Oriented Programming (OOP)

Database Schema

Database

  • library

Table

  • 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

SQL Concepts Implemented

  • CREATE DATABASE
  • CREATE TABLE
  • PRIMARY KEY
  • AUTO_INCREMENT
  • UNIQUE Constraints
  • NOT NULL Constraints
  • INSERT
  • SELECT
  • UPDATE
  • DELETE
  • WHERE Clause
  • Parameterized Queries

OOP Concepts Implemented

Classes and Objects

  • Books
  • Library

Inheritance

  • Library inherits from Books

Methods

  • Add Books
  • View Books
  • Search Books
  • Issue Books
  • Return Books
  • Remove Books

Encapsulation

Database operations are organized within class methods.


Functionalities

Book Management

  • Add Books
  • View Books
  • Remove Books

Search Operations

  • Search using Book Number

Library Operations

  • Issue Books
  • Return Books
  • Track Available Copies

Database Operations

  • Insert Records
  • Retrieve Records
  • Update Records
  • Delete Records

Project Structure

Library-Management-System-MySQL/
│
├── sql_connector.py          # Creates database and table
├── library_management.py     # Main application
├── README.md

Prerequisites

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-python

Database Setup

The 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.


How to Run

  1. Clone the repository.
git clone https://github.com/Navin-Verma/library-management-system-mysql.git
  1. Navigate to the project directory.
cd library-management-system-mysql
  1. Update your MySQL credentials in sql_connector.py.
host="localhost"
user="root"
password="your_password"
  1. Run the application.
python library_management.py

Learning Outcomes

This 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

Future Enhancements

  • 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

Author

Navin Verma

GitHub: https://github.com/Navin-Verma


⭐ If you found this project useful, consider giving it a star on GitHub!

About

A complete Library Management System built with Python and MySQL, demonstrating CRUD operations, SQL integration, and database management.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages