Library Management System
Issue and return books, track members, and calculate fines — Python and MySQL.
- Python
- MySQL
- mysql-connector
About this project
A library counter program: add books and members, issue a book, take a return, and calculate the fine on anything overdue. Search by title, author or accession number, and print a list of what is currently out.
What makes this a better second database project than the usual CRUD exercise is the relationship. A book can be issued many times and a member can borrow many books, so the interesting data lives in neither table but between them. Getting that join table right — and deriving availability from it rather than keeping a separate "is_available" column that drifts out of sync — is the whole point.
Scope, plainly: one counter, one operator, one machine. A learning exercise, not library software.
What you will learn
- Model a many-to-many relationship properly, with a join table rather than a repeated column
- Write a JOIN across three tables and understand what it returns
- Work with dates in SQL — due dates, overdue days, and fine calculation
- Enforce a rule the database can hold, such as not issuing a book that is already out
- Explain why availability is derived from the issue table instead of stored twice
Before you start
- Python basics — variables, loops, functions
- SQL: SELECT with WHERE and JOIN
- MySQL installed locally, or access to any MySQL server
New to Python? The free Python course covers everything this project assumes.
Academic integrity notice
These projects are provided for learning, experimentation and reference. Understand the code, modify it for your own requirements, and acknowledge external work according to your institution’s academic policies. Priodemy does not supply work to be submitted as your own.
Features
- Books, members, and an issues table modelling the many-to-many relationship
- Issue and return, with the rule that a book already out cannot be issued again
- Fine calculated from the due date, with a configurable per-day rate
- Availability derived from the issue table, never stored twice
- Search by title, author or accession number
- Currently-issued and overdue reports written as SQL joins
- Parameterised queries throughout
Technology stack
Track: Python & AI/ML · Level: Mini project
What is included
- Full Python source, commented
- MySQL schema (.sql) with sample books and members
- Setup and installation guide
- An explanation of the three-table design and the join that ties it together
- Sample output for every menu option
Delivered as a 13 KB ZIP. SHA-256 published under Changelog so you can verify it.
System requirements
- Operating system
- Windows, macOS or Linux
- Runtime
- Python 3.10 or newer
- Database
- MySQL 8.0 or newer
Licence
Learn from it, change it, and use it in your own coursework and personal projects. Do not resell it or pass it off as your own original work.
- Personal and educational use
- Modifying the code however you like
- Using it as the basis of your own coursework, with honest acknowledgement
- Putting your modified version in a portfolio or on your own GitHub
- Reselling or redistributing the project, modified or not
- Presenting it as your own original work
- Commercial deployment — see the Commercial licence
Support window: 6 months from download.
Frequently asked
Is this suitable for a Class 12 or BCA project?
Yes — it is the standard shape both expect, and it is a step up from a single-table project because of the join. Use it as a reference implementation: understand it, adapt the schema to your own requirements, and write your own documentation.
Why not just keep an "available" column on the books table?
Because then the same fact is stored in two places and they drift apart the first time something goes wrong mid-transaction. Deriving availability from the issues table means it cannot disagree with itself. The included notes work through this with an example.
Can a real library use this?
No. There are no logins, no permissions, no backups and no reservations — it is a teaching program for one operator on one machine. Schools wanting a working library module have it inside Priodemy EduSuite.
How are fines calculated?
Days overdue multiplied by a rate set in one place in the config, computed in SQL from the due date rather than in Python. The guide explains how to change the loan period and the rate.
Changelog
- First release
SHA-256a24517a72b17399def293fa6c486fe3ffa51c78d7cebd77ca4b96227f1a4f6dc