0% found this document useful (0 votes)
16 views35 pages

CS XII - Project - SANNIDH

The document is a project report on a Library Management System submitted by Sannidh B for the Computer Science practical examination at Velammal Bodhi Campus. It includes sections on Python programming, database management using SQL, and the integration of Python with MySQL for backend functionality. The report outlines the objectives, system requirements, and provides source code and execution screenshots.

Uploaded by

Yuvaraj pandi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views35 pages

CS XII - Project - SANNIDH

The document is a project report on a Library Management System submitted by Sannidh B for the Computer Science practical examination at Velammal Bodhi Campus. It includes sections on Python programming, database management using SQL, and the integration of Python with MySQL for backend functionality. The report outlines the objectives, system requirements, and provides source code and execution screenshots.

Uploaded by

Yuvaraj pandi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

VELAMMAL BODHI CAMPUS

KOLAPAKKAM, CHENNAI – 600 128

A Project Report On

“ LIBRARY MANAGEMENT SYSTEM ”


Submitted By

Roll No :
Name : SANNIDH .B
Class : XII

Under the Guidance Of


MR. HARIKUMAR R

Department of Computer Science

1
VELAMMAL BODHI CAMPUS

DEPARTMENT OF COMPUTER SCIENCE


2024 - 2025

CERTIFICATE

The project report is entitled.


“ LIBRARY MANAGEMENT SYSTEM ”
This is to certify that this is the bonafide record of project work done
by Master / Miss. SANNIDH .B of Grade XII during the
academic year 2024-2025.

Submitted for SSCE-2025 Computer Science Practical Examination


held on at Velammal Bodhi Campus, Kolapakkam,
Kanchipuram District.
Date: . Teacher In-charge

PRINCIPAL INTERNAL EXAMINER EXTERNAL EXAMINER

2
DECLARATION

I hereby declare that the project work entitled

“ LIBRARY MANAGEMENT SYSTEM ”,

submitted to the Department of Computer Science, The

Velammal Bodhi Campus, is a record of an original work

done by me and my team. All the coding is the result of my

team's personal efforts.

XII COMPUTER SCIENCE

3
ACKNOWLEDGEMENT

First of all we thank our beloved parents for providing us the


opportunity to study in Velammal Bodhi Campus, Kolapakkam.

We thank our beloved Director Sri. M. V. M SASIKUMAR for


being our motivational force for the completion of this project.

We thank our Principal Smt. R. LAVANYA for her exceptional


support.

We thank our Computer Science Faculty MR. HARIKUMAR R for


encouraging and guiding us to complete this project.

Last but not the least I thank all my friends who helped me in the
completion of this project.

4
CONTENTS

1. INTRODUCTION TO PYTHON

2. PROJECT ON LIBRARY MANAGEMENT SYSTEM

3. INTRODUCTION

4. OBJECTIVES

5. SYSTEM REQUIREMENTS

6. FRONTEND DETAILS

7. SOURCE CODE

8. BACKEND DETAILS

9. SCREENSHOTS OF EXECUTION

10. BIBLIOGRAPHY

5
INTRODUCTION TO PYTHON

Python is an interpreter, object-oriented, high-level programming


language with dynamic semantics. Its high-level built in data structures,
combined with dynamic typing and dynamic binding; make it very attractive for
Rapid Application Development, as well as for use as a scripting or glue
language to connect existing components together. Python's simple, easy to
learn syntax emphasizes readability and therefore reduces the cost of program
maintenance.
Python supports modules and packages, which encourages program
modularity and code reuse. The Python interpreter and the extensive standard
library are available in source or binary form without charge for all major
platforms, and can be freely distributed.

History of Python
Python was developed by Guido van Rossum in the late eighties and
early nineties at the National Research Institute for Mathematics and Computer
Science in the Netherlands. Python is derived from many other languages,
including ABC, Modula-3, C, C++, Algol-68, SmallTalk, and Unix shell and
other scripting languages.
Python is copyrighted. Like Perl, Python source code is now available
under the GNU General Public License (GPL). Python is now maintained by a
core development team at the institute, although Guido van Rossum still holds
a vital role in directing its progress.

6
Python Features
● Easy-to-learn − Python has few keywords, simple structure, and a
clearly defined syntax. This allows the student to pick up the language
quickly.
● Easy-to-read − Python code is more clearly defined and visible to the eyes.
● Easy-to-maintain − Python's source code is fairly easy-to-maintain.
● A broad standard library − Python's bulk of the library is very portable
and cross-platform compatible on UNIX, Windows, and Macintosh.
● Interactive Mode − Python has support for an interactive mode which
allows interactive testing and debugging of snippets of code.
● Portable − Python can run on a wide variety of hardware platforms and
has the same interface on all platforms.
● Extendable − You can add low-level modules to the Python interpreter.
These modules enable programmers to add to or customize their tools to
be more efficient.
● Databases − Python provides interfaces to all major commercial databases.
● GUI Programming − Python supports GUI applications that can be
created and ported to many system calls, libraries and windows systems,
such as Windows MFC, Macintosh, and the X Window system of Unix.
● Scalable − Python provides a better structure and support for large
programs than shell scripting.
Apart from the above-mentioned features, Python has a big list
of good features, few are listed below:–

● It supports functional and structured programming methods as well as OOP.


● It can be used as a scripting language or can be compiled to byte-code
for building large applications.

7
● It provides very high-level dynamic data types and supports dynamic
type checking.
● It supports automatic garbage collection.
● It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java

DATA FILE HANDLING IN PYTHON:


A file is a sequence of bytes on the disk/permanent storage where a group
of related data is stored. File is created for permanent storage of data. In
programming, Sometimes, it is not enough to only display the data on the
console. Those data are to be retrieved later on, and then the concept of file
handling comes.
It is impossible to recover the programmatically generated data again
and again. However, if we need to do so, we may store it onto the file system
which is not volatile and can be accessed every time. Here, comes the need of
file handling in Python. File handling in Python enables us to create, update,
read, and delete the files stored on the file system through our python program.
The following operations can be performed on a file. In Python,
File Handling consists of following three steps:
✔ Open the file.
✔ Process file i.e. perform read or write operation.
✔ Close the file.
TYPES OF FILE:
There are two types of files:
Text Files: A file whose contents can be viewed using a text editor is called a
text file. A text file is simply a sequence of ASCII or Unicode characters.
Python programs, contents written in text editors are some of the example of
text files.

8
Binary Files: A binary file stores the data in the same way as stored in the
memory. The .exe files, mp3 file, image files, word documents are some of the
examples of binary files. We can’t read a binary file using a text editor.
CSV Files: A Comma Separated Values (CSV) file is a plain text file that
contains a list of data. These files are often used for exchanging data between
different applications. For example, databases and contact managers often
support CSV files. These files may sometimes be called Character Separated
Values or Comma Delimited files. They mostly use the comma character to
separate (or delimit) data, but sometimes use other characters, like semicolons.

SQL (Structured Query Language) :


It is a standard language for accessing and manipulating databases.SQL
commands are used to create, transform and retrieve information from
Relational Database Management Systems. They are also used to create
interface between user and database.In Relational database Model all the
information is stored on Tables, these tables are divided into rows and columns.
A collection on related tables are called DATABASE. A named table in a
database is called RELATION in Relational Data Model. Row in a table is
called TUPLES, and column of a Table are called ATTRIBUTE. No. of rows in
a table is called DEGREE of the table and no. of columns in a tables in called
CARDINALITY.
Primary Key: An attribute or a group of attribute which can distinguish row
uniquely in a table is Called Primary key/Key Field/Key
attribute.
Candidate key: The attributes which are capable to act as a primary key is
known as candidate key.
Alternate key: An attribute which can act as a primary key in place of
primary key as called alternate key.

9
Foreign Key: An attribute in its present table whose values are derived from
some other table, is called foreign key in the present table.
Create Table: This DDL command is used to create a new table into any
existing database. The syntax of this command is as follows:
Syntax:
Create table <tblname> ( column_name datatype size constraints ,
column_name datatype size constraints ,
column_name datatype size constraints , );
Example:
Sql> Create table student ( admno number(4) , roll number(2),
Name char(30), fname char(30), DOB date, Address
varchar(80) );
To see the structure of the above defined table is as
follows Sql> desc student ;
ALTER TABLE: This DDL command is used to add / modify a column
in any existing table of a database.
The syntax of this command is as follows:
Syntax:
Alter table <tablename> ADD/MODIFY/DROP ( column_name
datatype size constraints , column_name datatype size constraints ,
column_name datatype size constraints , );
Example:
Task: To add a new column “ Phone “ having datatype char and size 12
in a table student
Sql > alter table student ADD ( phone char (12)) ;

Task : To change the datatype of admno into char and increase the size as

5 Sql > alter table student MODIFY ( admno char(5));

10
Task : Delete a column DOB from the table

student Sql > alter table student drop DOB;

Drop Table : This DDL command is used to remove a table from any
existing database.
Syntax:
Drop table < table name>
Example:
Sql> drop table student ;

INSERT COMMAND: This DML command is used to add a new row


( record/ tuple ) in any existing database table .
Syntax :
insert into < table name > values ( value1, value2, value 3,. value N );
Example :
Task: Add a new row in a table student ( which we have created
earlier) Sql > Insert into student values ( ‘1234A’,12, ‘joshin
gulati’,’’abcd’,
‘9-apr-2008’, ‘b-152 surya agar’);
SELECT COMMAND: This DML command is used to retrieve information
from any table (s) to display/ list/ report on the screen, but this command cannot
any how update / modify any table.
The syntax of this command is as follows,
Syntax : Select [ * / column list ] from < table name> [ where <
condition > ] [ order by < col name..> [asc/desc] ] [ group by < col
name>]
Examples:
Task : To display all the records of table
EMP Sql > select * from EMP;
11
Task: To display only the employee no and employee
name Sql > select empno , ename from EMP;
Where clause: It is used to restrict the no no of rows from being displayed on the
screen.
Task: display all the employees whose salary is greater than
1500 Sql > select * from emp where sal > 1500;

Update: This DML command is used to change/modify the record(s) of any table.
The syntax is as follows
Syntax:
Update < tablename> Set column Name = value [ where < condition> ]

Example:
1. Update emp
Set sal = sal + sal * 0.05; ( Give an increment of 5 % to each employee )
2. update emp
set sal = sal+ sal * 0.05
where job =’PRESIDENT’; (Give an increment o f 5% to president only)
DELETE: This DML command is used to delete a row/ tuple(s) from a table.
The Syntax is as follows,
Syntax:
DELETE from <tablename > [ where < condition > ]
Example
1. Delete from emp ; ( delete all the records leaving it’s structure intact)
2. Delete from emp where sal >=3000 ;

12
Create View: This Command is used to create a new View in any existing database.
The syntax is as follows:
Syntax:
Create view < viewname> As Select command
Example:
create view abc as select empno,job,sal from emp;
Drop View : This command is used to drop any existing view from the database.
The syntax is as follows,
Syntax:
Drop View < viewname>
Example:
Drop view abc;

Interface Python with MySQL:


● Databases play a vital role in the efficient working of an organization.
● They are essentially collection of tables and are connected with each other
● through columns.
● These database systems support SQL, which is used to create, access and
manipulate data.
● The python programming language has powerful features for database programming.
● Python support various database servers like MySQL, Oracle, Sybase, mSQL,
Microsoft SQL server 2000 etc.
● For database programming the python DB-API is a widely used module that
provides a database application programming interface. It is a standard for database
interface.

13
PYTHON - MYSQL CONNECTIVITY:
● Usually the data inputted by the user along with the generated output is
displayed but not stored because all execution takes place in RAM which is a
temporary memory and as soon as we close the form, its contents gets erased.
● Thus, when the application is executed the second time,it requires a new
set of inputs from the user.
● This can be overcome by sending the output generated and saving the input
fetched from the user in a database created at the back end of the application.
● The input is fetched from the user using python interface. This is known
as FRONTEND interface of the application.
● An application usually stores a lot of data in the form of a database which is not
directly accessible by the user.
● This database is used by the application to give suitable response to the user,
This database is called BACK-END databases.

Some important points are as follows:


● To connect to a database from within a programming application, you need a
framework that facilitates communication between two different genres of
software (programming application and DBMS).
● To connect front Python to MYSQL, you need a library called
MySQL connector.
● You must import mysql.connector in the Python program/script before writing
code of connectivity.

14
Steps to create a database connectivity Python application are:
Step 1. Start Python: start Python’s editor where you can create your python
scripts, i.e; IDLE.
Step 2. Import the package required for database programming.
Here you need to import mysql.connector package in your python scripts.
Step 3. Open a connection: Here we need to establish a connection to MYSQL
database using connect(). This requires 4 parameters, the syntax for this
is as follows:
<Connection_object> = mysql.connector.connect(host= <host_name>, user=
<username>, passwd =<password> , [database = <databasename>])
Example:
import mysql.connector as m
mydb = m.connect(host =”Iocalhost” , user = ”root", passwd = ”admin", database =”test”)
Step 4. Create a cursor instance.
Here we have to create an instance of cursor by using cursor(), the syntax for the
following is as follows:
<cursorobject> =<connectionobject>.cursor()
i. e; in the above connection we can create cursor() by
writing: mycursor = mydb.cursor()
Step 5: Execute a query. Here we use be execute() with following syntax.
< cursorobject>.execute(‹sql query
strings) i.e; mycursor.execute("select
* from data”)
Step 6: Extract data from result set. Here you can fetch the data from the result set by
using fetch( ) functions.
[fetchall(), fetchmany(<n>), fetchone()]
Step 7. Clean up the environment.

15
● A database Connection object controls the connection to the
database. It represents a unique session with a database connected
from within a script/program.
● A Database Cursor is a special control structure that facilitates the row by
row processing of records in the resultset, i.e., the set of records retrieved
as per query.
● The resultset refers to a logical set of records that are fetched from the
database by executing an SQL query and made available to the application
program.
● You can use connect() method for establishing database connection. cursor() to
create a cursor and execute() to execute an SQL query.
● For INSERT, UPDATE and DELETE queries, you must run commit() with
the connection object (Here that is mydb).

16
INTRODUCTION

The Library Management System is a software-based solution designed to automate and


streamline the operations of a library. This project focuses on efficiently managing key aspects
such as book inventory, member records, and transaction details like issuing and returning
books. It eliminates the challenges associated with manual processes, such as maintaining
physical records, repetitive data entry, and error-prone operations.

Built using Python and MySQL, this system ensures a seamless integration between user-
friendly interfaces and a robust back-end database. The primary goal is to simplify library tasks
for both administrators and users, enabling the efficient handling of book-related activities.
Users can search for books, issue or return them, and librarians can manage book stocks,
member registrations, and transaction histories effortlessly.

This project not only reduces operational costs but also saves time for librarians and users,
providing a modern and accessible solution for library management. It is especially ideal for
educational institutions seeking to maintain organized and accessible libraries that support
academic excellence.

17
OBJECTIVES

The main objective of the Library Management System project is to manage the details of
students, books, issues, and members effectively. The project automates key processes to
enhance efficiency, save time, and reduce errors.

1. Efficient Management:
The system handles the details of students, books, issues, and members, providing an
organized and efficient solution for library operations.

2. Automation of Tasks:
Tasks such as adding, updating, and managing books, issuing and returning books,
and managing member information are fully automated, reducing repetitive manual
work.

3. Error Minimization:
By automating critical processes, the system minimizes the chances of human errors
in operations like book quantity updates and transaction management.

4. Time-Saving:
The system saves time for both librarians and users by providing quick access to
information about book availability and transaction history.

5. Easy Database Management:


Adding, removing, or updating books and member information is simplified with
intuitive commands, enabling smooth database management.

18
6. Basic Stock Management:
The system supports basic stock management, such as tracking book quantities and
updating inventory upon issuing or returning books.

7. User-Friendly Organization:
Books are managed systematically in the database, making it easier for librarians to
maintain and retrieve records.

8. Educational Support:
The system ensures students have quick access to book-related information,
supporting their academic requirements.

19
SYSTEM REQUIREMENTS

HARDWARE REQUIREMENTS

Processor Pentium III and above

RAM 256 GB (Minimum)

Hard Disk 20 GB (Minimum)

Printer To print the required documents of the Project

SOFTWARE REQUIREMENTS

Operating System Windows 7 or higher

Front-End Python IDLE 3.6 or higher or Spyder

Back-End MySQL Server 5.5 or higher /


Data Files in Python – Binary files, CSV files

Documentation Microsoft Word 2010 or higher

20
FRONT END

21
22
SOURCE CODE

23
24
25
26
27
28
BACK END

29
Tables in Library Management System:

Books Table:

Members Table:

30
Transactions Table:

31
SCREENSHOTS
OF
EXECUTION

32
33
34
BIBLIOGRAPHY & REFERENCES

 Websites References:

https://www.tutorialspoint.com/index.htm

https://www.javatpoint.com

https://www.w3schools.com

https://html.com

 Books References:

Head First Python: A Brain-Friendly Guide

Programming Python: Powerful Object-Oriented

Programming The Pragmatic Programmer

35

You might also like