LIBRARY MANAGEMENT SYSTEM
Developed using Python and MYSQL
This project is a Library Management System built with Python and MySQL. It enables library administrators to efficiently manage books and student registrations, handle book issuances and returns, and display book records through a terminal-based interface.
- Add Book: Add a new book to the library database.
- Issue Book: Issue books to students and track the issuance date.
- Submit Book: Record the return of books and calculate any applicable late fees.
- Delete Book: Remove a book entry from the database.
- Display Books: View all books available in the library.
- Student Registration: Register new students in the library system.
- Password Protected: Access to the application is secured with a password.
- Python 3.x: Install Python from python.org.
- MySQL Server: Install MySQL from mysql.com.
- Required Python Libraries:
mysql-connectorpandasdatetime
Install the libraries using the following command:
pip install mysql-connector-python pandas-
Database Setup:
- Create a database named
mydb_libraryin MySQL. - Define the following stored procedures in your MySQL database:
proc_bookresigtrationproc_bookissueproc_bookreturnproc_bookdeleteproc_studentregistration
- Create a database named
-
Modify Database Connection: Update the
create_server_connectionfunction in the script to include your MySQL credentials:connection = create_server_connection("localhost", "root", "your_password", "mydb_library")
-
Run the Script: Execute the script using:
python library_manager.py
-
Password: The default password to access the system is
XYZ@SCHOOL.
- Run the script and enter the password to access the system.
- Choose an option from the menu to perform the desired task:
- Add a book by providing the book name, code, total copies, and subject.
- Issue a book by entering the student's registration number, book code, and issuance date.
- Return a book by providing the registration number, book code, and return date.
- Delete a book by entering its code (only if it is not issued).
- Display all books in the library.
- Register a new student by entering their name and registration number.
- The application will return to the main menu after each task.
create_server_connection: Establishes a connection to the MySQL database.addbook: Adds a new book to the library using theproc_bookresigtrationstored procedure.issueb: Issues a book to a student using theproc_bookissuestored procedure.submitb: Records a book return using theproc_bookreturnstored procedure.dbook: Deletes a book using theproc_bookdeletestored procedure.dispbook: Displays all books in the library.studentreg: Registers a new student using theproc_studentregistrationstored procedure.pswd: Handles password authentication.main: Displays the menu and manages user navigation.
- Stored Procedure Validation: Ensure all stored procedures are implemented correctly in the database.
- Error Handling: Improve error messages for better debugging.
- Password Security: Replace the plaintext password with a hashed password for enhanced security.
- Resource Management: Ensure the database connection is properly closed after each operation.
- GUI Interface: Develop a graphical user interface for better user experience.
This project is open-source and available for educational purposes. Feel free to use and modify it as needed.
Sayak
- B.Tech in Computer Science and Communication Engineering, KIIT University.