0% found this document useful (0 votes)
14 views

libraryManagment

Uploaded by

Saim Keshri
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)
14 views

libraryManagment

Uploaded by

Saim Keshri
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/ 103

S.S.

Memorial College, Ranchi

A PROJECT REPORT ON

AI LIBRARY MANAGEMENT
SYSTEM IN PYTHON
SUBMITED BY
Name: SADAF KHAN
Session: 2019 -2022

RU Roll No.: 19BC5873313


Department: BCA
Abstract

The purpose of Library Management System is to automate the


existing manual system by the help of computerized equipments
and full-fledged computer software, fulfilling their requirements, so
that their valuable data/information can be stored for a longer
period with easy accessing and manipulation of the same. The
required software and hardware are easily available and easy to
work with. Library Management System, as described above, can
lead to error free, secure, reliable and fast management system. It
can assist the user to concentrate on their other activities rather to
concentrate on the record keeping. Thus it will help organization
in better utilization of resources. The organization can maintain
computerized records without redundant entries. That means that
one need not be distracted by information that is not relevant,
while being able to reach the information. The aim is to automate
its existing manual system by the help of computerized
equipments and full-fledged computer software, fulfilling their
requirements, so that their valuable data/information can be
stored for a longer period with easy accessing and manipulation
of the same. Basically the project describes how to manage for
good performance and better services for the clients.
ACKNOWLEDGEMENT

I would like to acknowledge all those without whom this


project would not have been successful. I am thankful to
Mr. SIBLI AKHTAR sir for his ongoing support during
the project, from initial advice, and encouragement, which
led to the final report of this project. I would wish to
thank Prof. Mr. Kunal who guided me throughout the
project and gave his immense support. He made me
understand how to successfully complete this project and
without him, the project would not have been complete.
This project has been a source to learn and bring our
theoretical knowledge to the real-life world. So, I would
really acknowledge his help and guidance for this project.
I would also like to thank my parents and friends who
have always been there whenever needed. Once again,
thanks to everyone for making this project successful.
DECLARATION
I the students of “Bachelor of Computer Application” of
S.S. Memorial College, Ranchi declare that the work
entitled "AI LIBRARY MANAGEMENT SYSTEM" has
been successfully completed under the guidance of Prof.
SHIBLI AKHTAR coordinator of BCA Department,
S.S. Memorial College, Ranchi. This dissertation work is
submitted in partial fulfillment of the requirements for
the award of Degree of Bachelor of Computer
Application during the academic year 2019 - 2022.

Signature of the student:


SADAF KHAN(19BC5873313)

Date: 16-07-2022

Place:Ranchi
S.S. Memorial College, Ranchi

CERTIFICATE

This is to certify that the project report entitled. “AI


LIBRARY MANAGEMENT SYSTEM ”. Submitted to
S.S. Memorial College, Ranchi in partial fulfilment of
the requirement for the award of degree of Bachelor of
Computer Application is an original work carried out by
SADAF KHAN (19BC5873313).

Internal Signature External Examiner


(Guide): (Signature):
CONTENTS
*Acknowledgement

*Abstract

1. INTRODUCTION
1.1 Organization Profile
1.2 AI Library Management System

2. SYSTEM ANALYSIS
2.1 Existing System
2.2 Proposed System
2.3 Feasibility Study

3. MODULE DESCRIPTION
3.1 Add Image
3.2 Construct Image
3.3 Add books
3.4 Issue books Details
3.5 Delete books Details
3.6 View book lists
3.7 Issue books to students
3.8 Return books

4. SYSTEM REQUIREMENTS
4.1 Software Requirements

5. OVERVIEW OF PYTHON
6. MYSQL - INTRODUCTION
7. TESTING
8. IMPLEMENTATION
9. CONCLUSION
10. BIBLIOGRAPHY
INTRODUCTION
Library management systems are designed to manage the
movement of books and maintain records of the members
in a library. The software solution is designed based on
the system requirements, the people involved, the content
of the operation and the activity to be performed.

The system requirement in library management focuses


on the possibility of search for books by title, author or
subject by the member. They should be able to locate a
book physically by the unique identification code and the
rack number for each book. The system should provide
details on the books held by the members. The system
should limit the number of books that can be taken and the
number of days that a book can be kept for. The system
should generate fines when due from the member.
The next step focuses on the functions of the librarian, the
member and the system. Managing books by the librarian,
searching for books by the members and notifications sent
by the system are detailed in a case diagram.

The third step in the design of the library management


system software is based on the different aspects of a
library. The name of the library, the book details, member
details, membership cards, book reservations, book
lending, cataloging, fines, book racks and notifications are
consolidated as a class diagram.

The next step further breaks down the functions into


specific activities that are performed in a library. An activity
diagram based on the primary activities – checking out a
book, returning a book and renewing a book – is drawn.

The final stage is coding for each activity in the case, class
and activity diagrams. This is the most important function
in the design of the library management system software.

Library management system gitHub, the software created


using Python, stores data on a log file. The software
systems are developed on this platform.

WHAT SYSTEM DOES A LIBRARY USE?


The library management system software should be
user-friendly and cost effective. It should be in tune with
the establishment’s needs and compatible with the
existing technology.

A library should use a software system that helps in


effectively managing the data in a library. The library
database includes all relevant information regarding
assets to membership details. The software records
details on all reading and reference material available
for reading and lending. Membership information,
lending details and renewal dates are managed by the
software.

A library management system software with capabilities


of barcoding and RFID helps in scanning the barcode
while lending or returning books. Management of the
catalogue and inventory by the system makes the
process accountable.

The feature of the software assists in inventory


and circulation management of the books. Books in
stock, on the shelves, in circulation, missing or to be
ordered can be tracked by the system. Acquiring new
assets becomes easier with the software.

Reports on members details, fees collected, pending


payments and overdue fines are generated by the library
management software system. Members are sent
reminders on renewals and return dates. The software
prints membership cards and creates user IDs.

Commonly used library management system websites


world-wide are Handy Library Manager, Librarian, Insignia
Library System, Lucidea Integrated Library Systems. The
best library management system in India is MarvelSoft.
GLibrary, My Library, Ampletrails Library are a few other
web based library management systems used in India.

HOW DO YOU MANAGE A LIBRARY?


Managing a library requires knowledge of library
management and skills to perform the activities. The
task involves planning, decision making, organizing,
collecting and disbursing information and controlling and
monitoring the various functions.

The management should have an objective for running


the library. They should have a clear idea of the
members they wish to serve. The selection of books in
different categories is dependent on the interests of the
members.
An understanding of the organizational hierarchy will
enable proper delegation of responsibilities to the
personnel employed. Governmental regulations regarding
structure, space and systems should be in place.

A budget has to be allocated for the operation of the


library. Maintenance of the library has to be scheduled on
a regular basis. Dusting, cleaning, pest control, exposure
to air and sunlight, replacement of fixtures are essential in
preserving the library.

A proper inventory check has to be done annually to


record the details of books in circulation. Provisions for the
replacements have to be done accordingly.

These are the basics for operating a library efficiently. In a


traditional library all these functions were done manually
by people. The process was time consuming and
expensive. In today’s digital world software solutions have
been developed for library management. This system
performs all the adequate functions with increased
efficiency and accuracy saving time and costs.

Library management software system makes the primary


functions of adding and deleting, issuing and returning of
books very simple. The processes of book indexing,
cataloging, book reservations and overdue notifications
are automated. The software system makes the process
simpler and more accountable.
THE MAIN CLASSES OF OUR LIBRARY
MANAGEMENT

The library management system software is based on the


different sections or classes involved in the operation of a
library. The functions and attributes of the classes and
relationships between them are specified in a Class
Diagram. This diagram forms the fundamental step in
building the management software.
Library management system class:
This class manages the entire library management functions and
is the focal point on which the software is designed. The
attributes of User type and User name with the functions of
Register, Login and Logout are vital to any web based library
management system.
Librarian class:
This class manages all the operations of the Librarian. The
name, ID and respective password for the librarian are verified.
The search string used by them in searching for books is saved
for future use.
User class:
The operations of the user are managed by this class. Name and
ID of the user is verified. Information on the books accessed by
each user is recorded.
Book class:
All operations pertaining to the books are managed by this class.
Books are classified on the attributes of title, author, subject and
date of publication.
Account class:
Accounting functions are dealt with by this class. This class
keeps track of the borrowed books, reserved books, returned
books, lost or missing books and the fine amounts due.
Library database class:
The database of the library is controlled by this class. The list of
books are classified and managed for easy search by this
function. Books can be added, deleted, updated and displayed in
the library management system software.
Student class:
The operations of the students are managed by this class. Books
pertaining to the age and grade of the students are classified and
frequently used books are saved for later reference.
Staff class:
The operations of the staff are monitored by this class.
Department wise functions are detailed and periodic checks are
made.
CHECK-LIST FOR SELECTING A LIBRARY
MANAGEMENT SYSTEM

The selection of the library management system software


depends on the type of library that needs to be automated.
Libraries can belong to a school or college, public libraries for
the community or specialized libraries for specific industries.
Each type of library has different requirements to cater to their
patrons.
The size of the collection of books, the type of library, the
budget, the staff size and the compatibility of the system with
working partners have to be considered when selecting a
software system.
Patron facing interface:
The objective of a library is to help the patrons to find the right
book. These interfaces with other tools allow patrons to search
for what they want. The system should have filtering options for
older users and easy to use icons for the younger users. Patron
facing tools include the useful features of reservation of books,
displays and notifications. The browse feature permits the user
to search for books of interest by topic, genre or author.
Product conformation:
The library management system software has to be one that can
manage the entire work of the library. The software should be
flexible to suit the needs of the library. Primarily the work of the
librarian and that of the other staff have to be addressed by the
system. The system has to be user friendly and customizable to
each user – the librarian, the borrower or user, accountant and
other staff. The items, labels, reports and preferences should be
free to choose from.
Vendor track record:
The library has to do a check of the vendor and his capabilities
prior to buying. The provider has to demonstrate the product to
the users. The vendor has to install the library management
system software on the computers in the library.
Technical support and training:
The provider should be able to train the end users to
competently operate the system. They have to ensure prompt
service for technical hitches that might occur. Training for the
staff has to be provided when the software is updated.
Web support:
There are different types of library software. The installed
system should be supported by the web. A web based library
management system is the most ideal as it provides extensive
coverage of books, journals, reference resources.
Accessibility:
The system should allow the school libraries to manage their
student base from a central system accessible from anywhere,
anytime. It should be possible for management to view the
library operations from anywhere. The program should be
accessible from libraries, classrooms, computer labs, homes and
any place with an internet connection or web access.
Budget:
The cost of the library management system software depends on
the features it offers. It is best to list out exactly what functions
have to be managed to reduce the cost of purchase.

ADVANTAGES OF LIBRARY MANAGEMENT


SYSTEM SOFTWARE
User friendly system:
The library management systems are simple and easy to use for
the librarian as well as the students. The system provides online
and offline storage of data. The system automatically updates
and backups data. The system is flexible and can be adapted to
the needs of the institution.
Simplification of librarian duties:
The system allows the librarian to maintain a wide collection of
books, periodicals, journals, audio and video books and
pictorials. The librarian operations of addition and deletion of
books, tracking books, tracing missing books, reserving books
can be performed very easily.
Increased member engagement:
The web based library management system software can be
easily accessed from anywhere and at any time. The members
can search for books from classrooms, computer labs, home and
places where the internet is available. The system provides
access from smartphones and tablets to search books and
resources. The easy access increases engagement of the users.
Efficient data management:
The library management system software hosted from a cloud
platform is very efficient. The functions of cataloging, indexing,
referencing and circulation of books are managed automatically
and saved on the cloud for reliable and secure operations.
Time and effort saver:
The automated library system software eliminates the need for
manual entries. This saves the effort and time consumed in data
entry. Automation makes the database error free and accurate.
Automated reports:
The system reports the performance of the library automatically.
Charts and graphs are provided for review and tracking of the
library functions. This aids in making changes and
improvements to the library.
Cost effective:
Digital libraries eliminate the need for extensive paperwork and
too many staff. Maintenance overheads and operation costs are
reduced.
FEATURES OF LIBRARY MANAGEMENT SYSTEM
SOFTWARE

The best library management system software will have the


following features:
Catalog management:
to digitally keep track of what is available in the library. The
books will be catalogued by title, subject, author and date of
publishing.
Membership management:
to maintain a detailed database of the members. The system
records the name, ID and password of each user. The system
helps in ascertaining the track record of the member.
Circulation management:
to track the movement of books. The location of any book at any
point of time can be tracked. Misplaced or missing books can be
traced with ease. The details on books to be returned and that
which are overdue for return are provided on a daily basis.
Acquisition management:
to acquire new books and add them digitally. Irrelevant and
outdated books are deleted.
Bar-coding:
to give specific identification to each book. All books, old and
new, are bar-coded on the basis of title, author, topic and date of
publishing.
Barcode scanning
to read the barcode easily using RFID sensors. The database is
automatically updated when books are scanned while issuing or
returning.
Search function:
to enable both the librarian and the members to search the
catalog of books in the library. The search functions can be
filtered to the need of each user.
Online access:
to catalogues of other public libraries. The web based library
management system software provides access to different
associate libraries. This broadens the spectrum of search
benefitting the user considerably.
Self management:
to check in and check out books by oneself. The library
management system software of digital libraries allows the
members to login, search, select, issue and return books by
themselves.
Fee management:
to collect membership fees and manage individual member
accounts. The software calculates the fine due for non-return or
lost and damaged books. The members are intimated of the fines
by the system.

WHY SHOULD LIBRARIES INVEST IN LIBRARY


MANAGEMENT SYSTEM SOFTWARE?
Every library in schools, colleges, universities, and public
communities should invest in library management system
software to operate effectively and efficiently.
Ease of data management:
The library management software can manage the entire catalog
of books, database of members, and details of book movement.
The system operates with accuracy minimizing the errors and
loss of data that would occur in manual entries.
Book Resource management:
Librarians find it challenging to physically locate the books
when demanded by many members. The library management
software enables the librarian to search the records, track the
history and issue the book within minutes.
Time saving:
Manually entering data and writing records is time consuming.
With library management system software all activities in a
library can be done with a click of button saving time. The
members can find for themselves the availability of a book and
the librarian can locate and issue books quickly.
Cost effectiveness:
Institutions have fixed budgets for technological improvements
and consider installing new software as expensive. The one-time
cost of installing the software may be high but in the long run it
proves very cost effective as the maintenance cost is minimal.
The system eliminates the need for a large workforce reducing
the cost of operations.
Productivity:
Effective library management system software streamlines all
the operations of the library. Database management, real-time
reporting and communication with the members are done
through the system. This saves the librarian a lot of time which
he can utilize productively for other important work.
Efficiency:
Maintaining daily reports of books issued, renewed and
returned, misplaced and lost manually is a tiring process. The
automated system eliminates the need for manual entries,
minimizes errors, increases accuracy and efficiency of
operations.
Fee collection:
The library management system sends alerts and notifications to
students about library fees, books issued, due dates. The
librarian can access this automated data to collect the fees and
fines.

SYSTEM ANALYSIS
SYSTEM ANALYSIS EXISTING SYSTEM:
System Analysis is a detailed study of the various operations
performed by a system and their relationships within and
outside of the system. Here the key question is- what all
problems exist in the present system? What must be done to
solve the problem? Analysis begins when a user or manager
begins a study of the program using existing system. During
analysis, data collected on the various files, decision points and
transactions handled by the present system. The commonly
used tools in the system are Data Flow Diagram, interviews,
etc. Training, experience and common sense are required for
collection of relevant information needed to develop the
system. The success of the system depends largely on how
clearly the problem is defined, thoroughly investigated and
properly carried out through the choice of solution. A good
analysis model should provide not only the mechanisms of
problem understanding but also the frame work of the solution.
Thus it should be studied thoroughly by collecting data about
the system. Then the proposed system should be analyzed
thoroughly in accordance with the needs. System analysis can
be categorized into four parts. ü System planning and initial
investigation ü Information Gathering ü Applying analysis tools
for structured analysis ü Feasibility study ü Cost/ Benefit
analysis.

In our existing system all the transaction of books are done


manually, So taking more time for a transaction like borrowing
a book or returning a book and also for searching of members
and books. Another major disadvantage is that to preparing the
list of books borrowed and the available books in the library will
take more time, currently it is doing as a one day process for
verifying all records. So after conducting the feasibility study we
decided to make the manual Library management system to be
computerizeed.
PROPOSED SYSTEM
PROPOSED SYSTEM Proposed system is an automated Library
Management System. Through our software user can add
members, add books, search members, search books, update
information, edit information, borrow and return books in quick
time. Our proposed system has the following advantages. Ø
User friendly interface Ø Fast access to database Ø Less error Ø
More Storage Capacity Ø Search facility Ø Look and Feel
Environment Ø Quick transaction All the manual difficulties in
managing the Library have been rectified by implementing
computerization.

FEASIBLITY ANALYSIS

FEASIBILITY ANALYSIS Whatever we think need not be feasible


.It is wise to think about the feasibility of any problem we
undertake. Feasibility is the study of impact, which happens in
the organization by the development of a system. The impact
can be either positive or negative. When the positives
nominate the negatives, then the system is considered feasible.
Here the feasibility study can be performed in two ways such as
technical feasibility and Economical Feasibility. Technical
Feasibility: We can strongly says that it is technically feasible,
since there will not be much difficulty in getting required
resources for the development and maintaining the system as
well. All the resources needed for the development of the
software as well as the maintenance of the same is available in
the organization here we are utilizing the resources which are
available already. Economical Feasibility Development of this
application is highly economically feasible .The organization
needed not spend much m one for the development of t he
system already available. The only thing is to be done is making
an environment for the development with an effective
supervision. I f we are doing so , we can attain the maximum
usability of the corresponding resources .Even after the
development , the organization will not be in a condition to
invest more in t he organization .There fore , the system is
economically feasible.

MySQL – Introduction

What is a Database?
A database is a separate application that stores a
collection of data. Each database has one or more distinct
APIs for creating, accessing, managing, searching and
replicating the data it holds.
Other kinds of data stores can also be used, such as files
on the file system or large hash tables in memory but data
fetching and writing would not be so fast and easy with
those type of systems.
Nowadays, we use relational database management
systems (RDBMS) to store and manage huge volume of
data. This is called relational database because all the data
is stored into different tables and relations are established
using primary keys or other keys known as Foreign Keys.
A Relational Database Management System
(RDBMS) is a software that −
 Enables you to implement a database with tables,
columns and indexes.
 Guarantees the Referential Integrity between
rows of various tables.
 Updates the indexes automatically.
 Interprets an SQL query and combines
information from various tables.
RDBMS Terminology
Before we proceed to explain the MySQL database
system, let us revise a few definitions related to the
database.
 Database − A database is a collection of tables,
with related data.
 Table − A table is a matrix with data. A table in
a database looks like a simple spreadsheet.
 Column − One column (data element) contains
data of one and the same kind, for example the
column postcode.
 Row − A row (= tuple, entry or record) is a group
of related data, for example the data of one
subscription.
 Redundancy − Storing data twice, redundantly
to make the system faster.
 Primary Key − A primary key is unique. A key
value cannot occur twice in one table. With a
key, you can only find one row.
 Foreign Key − A foreign key is the linking pin
between two tables.
 Compound Key − A compound key (composite
key) is a key that consists of multiple columns,
because one column is not sufficiently unique.
 Index − An index in a database resembles an
index at the back of a book.
 Referential Integrity − Referential Integrity
makes sure that a foreign key value always points
to an existing row.
MySQL Database
MySQL is a fast, easy-to-use RDBMS being used for
many small and big businesses. MySQL is developed,
marketed and supported by MySQL AB, which is a
Swedish company. MySQL is becoming so popular
because of many good reasons −
 MySQL is released under an open-source license.
So you have nothing to pay to use it.
 MySQL is a very powerful program in its own
right. It handles a large subset of the functionality
of the most expensive and powerful database
packages.
 MySQL uses a standard form of the well-known
SQL data language.
 MySQL works on many operating systems and
with many languages including PHP, PERL, C,
C++, JAVA, etc.
 MySQL works very quickly and works well even
with large data sets.
 MySQL is very friendly to PHP, the most
appreciated language for web development.
 MySQL supports large databases, up to 50
million rows or more in a table. The default file
size limit for a table is 4GB, but you can increase
this (if your operating system can handle it) to a
theoretical limit of 8 million terabytes (TB).
 MySQL is customizable. The open-source GPL
license allows programmers to modify the
MySQL software to fit their own specific
environments.

Description of Project Files


Below are the project files you will get once you download
and extract the Library project:
 main.py – which does function call to all other
python files
 AddBook.py – To add the book
 ViewBooks.py – To View the list of books in the
library
 DeleteBook.py – To Delete a book from library
 IssueBook.py – To Issue a book from library
 ReturnBook.py – To Return a book to the library

Description of Tables
Create Tables
create database db;
create table books(bid varchar(20) primary key, title
varchar(30), author varchar(30), status varchar(30));
create table books_issued(bid varchar(20) primary key, issuedto
varchar(30));

1. books
2. issued_books

Before You Begin


Before you begin this tutorial, you should have a basic
knowledge of the information covered in our PHP and
HTML tutorials.
This tutorial focuses heavily on using MySQL in a PHP
environment. Many examples given in this tutorial will be
useful for PHP Programmers.
All downloads for MySQL are located at MySQL
Downloads. Pick the version number of MySQL
Community Server which is required along with the
platform you will be running it on.

Installing MySQL on Linux/UNIX


The recommended way to install MySQL on a Linux
system is via RPM. MySQL AB makes the following
RPMs available for download on its website −

MySQL − The MySQL database server manages the


databases and tables, controls user access and processes
the SQL queries.

MySQL-client − MySQL client programs, which make it


possible to connect to and interact with the server.

MySQL-devel − Libraries and header files that come in


handy when compiling other programs that use MySQL.

MySQL-shared − Shared libraries for the MySQL client.

MySQL-bench − Benchmark and performance testing


tools for the MySQL database server.
The MySQL RPMs listed here are all built on a SuSE
Linux system, but they will usually work on other Linux
variants with no difficulty.

Now, you will need to adhere to the steps given below, to


proceed with the installation −

Login to the system using the root user.

Switch to the directory containing the RPMs.

Install the MySQL database server by executing the


following command. Remember to replace the filename in
italics with the file name of your RPM.

[root@host]# rpm -i MySQL-5.0.9-0.i386.rpm


The above command takes care of installing the MySQL
server, creating a user of MySQL, creating necessary
configuration and starting the MySQL server
automatically.
You can find all the MySQL related binaries in /usr/bin
and /usr/sbin. All the tables and databases will be created
in the /var/lib/mysql directory.

The following code box has an optional but recommended


step to install the remaining RPMs in the same manner −

[root@host]# rpm -i MySQL-client-5.0.9-0.i386.rpm


[root@host]# rpm -i MySQL-devel-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-shared-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-bench-5.0.9-0.i386.rpm
Installing MySQL on Windows
The default installation on any version of Windows is
now much easier than it used to be, as MySQL now
comes neatly packaged with an installer. Simply
download the installer package, unzip it anywhere and run
the setup.exe file.
The default installer setup.exe will walk you through the
trivial process and by default will install everything under
C:\mysql.

Test the server by firing it up from the command prompt


the first time. Go to the location of the MySQL server
which is probably C:\mysql\bin, and type −

mysqld.exe --console
NOTE − If you are on NT, then you will have to use
mysqld-nt.exe instead of mysqld.exe

If all went well, you will see some messages about startup
and inorb. If not, you may have a permissions issue. Make
sure that the directory that holds your data is accessible to
whatever user (probably MySQL) the database processes
run under.

MySQL will not add itself to the start menu, and there is
no particularly nice GUI way to stop the server either.
Therefore, if you tend to start the server by double
clicking the MySQL executable, you should remember to
halt the process by hand by using mysqladmin, Task List,
Task Manager, or other Windows-specific means.

Verifying MySQL Installation


After MySQL, has been successfully installed, the base
tables have been initialized and the server has been
started: you can verify that everything is working as it
should be via some simple tests.

Use the mysqladmin Utility to Obtain Server Status


Use mysqladmin binary to check the server version. This
binary would be available in /usr/bin on linux and in
C:\mysql\bin on windows.

[root@host]# mysqladmin --version


It will produce the following result on Linux. It may vary
depending on your installation −
mysqladmin Ver 8.23 Distrib 5.0.9-0, for redhat-linux-
gnu on i386
If you do not get such a message, then there may be some
problem in your installation and you would need some
help to fix it.

Execute simple SQL commands using the MySQL Client


You can connect to your MySQL server through the
MySQL client and by using the mysql command. At this
moment, you do not need to give any password as by
default it will be set as blank.

You can just use following command −

[root@host]# mysql
It should be rewarded with a mysql> prompt. Now, you
are connected to the MySQL server and you can execute
all the SQL commands at the mysql> prompt as follows −

mysql> SHOW DATABASES;


+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.13 sec)
Post-installation Steps
MySQL ships with a blank password for the root MySQL
user. As soon as you have successfully installed the
database and the client, you need to set a root password as
given in the following code block −

[root@host]# mysqladmin -u root password


"new_password";
Now to make a connection to your MySQL server, you
would have to use the following command −

[root@host]# mysql -u root -p


Enter password: *******
UNIX users will also want to put your MySQL directory
in your PATH, so you won't have to keep typing out the
full path everytime you want to use the command-line
client.

For bash, it would be something like −

export PATH = $PATH:/usr/bin:/usr/sbin


Running MySQL at Boot Time
If you want to run the MySQL server at boot time, then
make sure you have the following entry in the /etc/rc.local
file.

/etc/init.d/mysqld start

Running and Shutting down MySQL Server


First check if your MySQL server is running or not. You
can use the following command to check it −
ps -ef | grep mysqld
If your MySql is running, then you will
see mysqld process listed out in your result. If server is
not running, then you can start it by using the following
command −
root@host# cd /usr/bin
./safe_mysqld&
Now, if you want to shut down an already running
MySQL server, then you can do it by using the following
command −
root@host# cd /usr/bin
./mysqladmin -u root -p shutdown
Enter password: ******
Setting Up a MySQL User Account
For adding a new user to MySQL, you just need to add a
new entry to the user table in the database mysql.
The following program is an example of adding a new
user guest with SELECT, INSERT and UPDATE
privileges with the password guest123; the SQL query is

root@host# mysql -u root -p
Enter password:*******
mysql>usemysql;
Database changed

mysql> INSERT INTO user


(host, user, password,
select_priv,insert_priv,update_priv)
VALUES ('localhost','guest',
PASSWORD('guest123'),'Y','Y','Y');
Query OK,1 row affected (0.20 sec)

mysql> FLUSH PRIVILEGES;


Query OK,1 row affected (0.01 sec)

mysql> SELECT host, user, password FROM user


WHERE user ='guest';
+-----------+---------+------------------+
| host | user | password |
+-----------+---------+------------------+
| localhost | guest |6f8c114b58f2ce9e|
+-----------+---------+------------------+
1 row inset(0.00 sec)
When adding a new user, remember to encrypt the new
password using PASSWORD() function provided by
MySQL. As you can see in the above example, the
password mypass is encrypted to 6f8c114b58f2ce9e.
Notice the FLUSH PRIVILEGES statement. This tells the
server to reload the grant tables. If you don't use it, then
you won't be able to connect to MySQL using the new
user account at least until the server is rebooted.
You can also specify other privileges to a new user by
setting the values of following columns in user table to 'Y'
when executing the INSERT query or you can update
them later using UPDATE query.
 Select_priv
 Insert_priv

 Update_priv

 Delete_priv

 Create_priv

 Drop_priv

 Reload_priv

 Shutdown_priv

 Process_priv

 File_priv

 Grant_priv

 References_priv

 Index_priv

 Alter_priv

Another way of adding user account is by using GRANT


SQL command. The following example will add
user zara with password zara123 for a particular
database, which is named as TUTORIALS.
root@host# mysql -u root -p password;
Enter password:*******
mysql>usemysql;
Database changed

mysql> GRANT
SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON TUTORIALS.*
-> TO 'zara'@'localhost'
-> IDENTIFIED BY 'zara123';
This will also create an entry in the MySQL database
table called as user.
NOTE − MySQL does not terminate a command until
you give a semi colon (;) at the end of the SQL command.
The /etc/my.cnf File Configuration
In most of the cases, you should not touch this file. By
default, it will have the following entries −
[mysqld]
datadir=/var/lib/mysql
socket =/var/lib/mysql/mysql.sock

[mysql.server]
user =mysql
basedir=/var/lib

[safe_mysqld]
err-log =/var/log/mysqld.log
pid-file =/var/run/mysqld/mysqld.pid
Here, you can specify a different directory for the error
log, otherwise you should not change any entry in this
table.
DFD for Library Management System
Data Flow Diagram (DFD) depicts the flow of information and the
transformation applied when a data moves in and out from a
system. The overall system is represented and described using
input, processing and output in the DFD. The inputs can be:
Book request when a student requests for a book.
Library card when the student has to show or submit his/her
identity as a proof.
The overall processing unit will contain the following output that a
system will produce or generate:
Book will be the output as the book demanded by the student will
be given to them.

Information of demanded book should be displayed by the library


information system that can be used by the student while
selecting the book which makes it easier for the student.

Level 0 DFD –
Level 1 DFD –

At this level, the system has to show or exposed with more


details of processing.
The processes that are important to be carried out are:
Book delivery
Search by topic
List of authors, List of Titles, List of Topics, the
bookshelves from which books can be located are some
information that is required for these processes. Data
store is used to represent this type of information.

Level 2 DFD –
Out of scope:
Other activities like purchasing of new books, replacement
of old books or charging a fine are not considered in the
above system.
SOURCE CODE

FRONT PAGE:-

from tkinter import *


from PIL import ImageTk,Image
from tkinter.ttk import *
import tkinter.ttk as ttk
from lLog import *

t=Tk()
t.geometry("1600x800+0+0")
t.title("Library Magement System")
t.config(bg="DarkOrange1")

st=Style()
st.configure('W.TButton',font=('Arial!',25,'bold','underline'),foregrou
nd='red',background='black',borderwidth = '4')

#-------Heading with icon image------------


titlelbl=Label(t,text="AI LIBRARY MANAGMENT
SYSTEM",font=("times now
roman",50,"bold"),justify=CENTER,background="black",foregroun
d="gold")
titlelbl.config(anchor=CENTER)
titlelbl.place(x=0,y=0,width=1600,height=120)

img2=Image.open(r"C:\Users\hp\Desktop\logo6.png")
img2=img2.resize((200,100))
img2=ImageTk.PhotoImage(img2)
l=Label(t,image=img2)
l.place(x=5,y=10,width=200,height=100)

#---ICON_IMAGE---
icon1=Label(t)
icon1.place(x=100,y=125)

#------------------Rotaion photo--------------------------
x=1
def a():
global x
img=Image.open(r"libimage\p"+str(x)+".jpg")
img=img.resize((1300,650))
img=ImageTk.PhotoImage(img)
icon1.config(image=img)
icon1.image=img
x=x+1
t.after(1000,a)
if x==7:
x=1
a()

#----------------- start button------------


def next1():
lg()
b=Button(t,text="Töuch M€!!!",style='W.TButton',command=next1)

b.place(x=1250,y=730)
LOGIN PAGE:-

from tkinter import*

from PIL import ImageTk,Image

from tkinter.ttk import*

from tkinter import messagebox

from datetime import *

import mysql.connector

import mysql.connector as c

import time

import calendar

from lmain2 import main

def lg():

t=Tk()
t.geometry("1600x800+0+0")

t.title("Login!!!")

st=Style()

#-----------login page Bckground-------------

l=Label(t)

img=Image.open(r"E:\LIB.jpg")

img=img.resize((1600,700))

img=ImageTk.PhotoImage(img)

l.config(image=img)

l.image=img

l.place(x=0,y=105)

titlelbl=Label(t,text="AI LIBRARY MANAGMENT SYSTEM",font=("times


now
roman",50,"bold"),justify=CENTER,background="black",foreground="gold")

titlelbl.config(anchor=CENTER)

titlelbl.place(x=0,y=0,width=1600,height=120)

ll=Label(t)

img2=Image.open(r"C:\Users\hp\Desktop\logo6.png")

img2=img2.resize((200,100))

img2=ImageTk.PhotoImage(img2)

ll.config(image=img2)
ll.image=img2

ll.place(x=5,y=10,width=200,height=100)

#---------log background image-------------

lll=Label(t)

img3=Image.open(r"C:\Users\hp\Desktop\logobg.jpg")

img3=img3.resize((800,400))

img3=ImageTk.PhotoImage(img3)

lll.config(image=img3)

lll.image=img3

lll.place(x=385,y=400)

def clock():

h=str(time.strftime("%H"))

m=str(time.strftime("%M"))

s=str(time.strftime("%S"))

dd=str(time.strftime("%d"))

mm=int(time.strftime("%m"))

yy=int(time.strftime("%y"))
lbldate.config(text=dd)

lblmonth.config(text=str(mm))

lblyear.config(text=str(yy))

if int(h)>12 and int(m)>0:

lblnoon.config(text="PM")

if int(h)>12:

h=str((int(h)-12))

lblhr.config(text=h)

lblmin.config(text=m)

lblsec.config(text=s)

lblhr.after(200,clock)

lblhr=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")

lblhr.place(x=640,y=190,width=60,height=40)

lbldate=Label(t,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")

lbldate.place(x=640,y=240,width=60,height=40)

lblmin=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmin.place(x=710,y=190,width=60,height=40)

lblmonth=Label(t,text="Month",font=("times new
roman",15,"bold"),background="red",foreground="white")

lblmonth.place(x=710,y=240,width=60,height=40)

lblsec=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")

lblsec.place(x=780,y=190,width=60,height=40)

lblyear=Label(t,text="Year",font=("times new
roman",15,"bold"),background="red",foreground="white")

lblyear.place(x=780,y=240,width=60,height=40)

lblnoon=Label(t,text="AM",font=("times new
roman",15,"bold"),background="red",foreground="white")

lblnoon.place(x=850,y=190,width=60,height=40)

lblcurrent=Label(t,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")

lblcurrent.place(x=850,y=240,width=60,height=40)
clock()

#=================Heading content==========

l1=Label(t,text=" ɭOGIN ĦERE",font=("Californian


FB",30,"bold"),background="black",foreground="gold")

l1.place(x=665,y=410)

#=======TEXT AREA==============

l1=Label(t,text="* User Id
:",font='18',background="black",foreground="red")

l1.place(x=550,y=520)

t1=Entry(t,font="bold")

t1.place(x=700,y=520,width=320)

l2=Label(t,text="* Password
:",font='18',background="black",foreground="red")

l2.place(x=550,y=590)

t2=Entry(t,font="bold")

t2.place(x=700,y=590,width=320)

t2.config(show="*")

#==============MySql connectivity======================

def login():

if t1.get()=="" or t2.get()=="":
messagebox.showerror("Error","All fields are required",parent=t)

else:

try:

con=c.connect(host="localhost",user="root",password="",port="3306",
database="library_db")

cur=con.cursor()

cur.execute('select * from admin where email=%s and


password=%s',(t1.get(),t2.get()))

row=cur.fetchone()

if row==None:

messagebox.showerror('Error','Invalid Userid And


Password',parrent=t)

loginclear()

t1.focus()

else:

appscreen()

con.close()

except Exception as es:

messagebox.showerror('Error',f'Error Due to : {str(es)}',parent=t)

def loginclear():
t1.delete(0,END)

t2.delete(0,END)

def appscreen():

main()

#--------------------login Button------------------

u=Label(t)

b=Button(t,image=img)

img=Image.open(r"image\l1.jpg")

img=img.resize((152,48))

img=ImageTk.PhotoImage(img)

b.config(image=img,cursor="hand2",command=login)

b.image=img

b.place(x=550,y=640)

t2.config(show="*")

#--------------------exit Button------------------

u1=Label(t)
b=Button(t,image=img)

img=Image.open(r"image\bc.png")

img=img.resize((154,47))

img=ImageTk.PhotoImage(img)

b.config(image=img,cursor="hand2",command=t.destroy)

b.image=img

b.place(x=850,y=640)

def mouseClick():

rog=Toplevel()

rog.title("Change password")

rog.geometry("500x300+530+280")

rog.iconbitmap("aa.ico")

rog.resizable(0,0)

rog.configure(bg='powder blue')

label=Label(rog,text="New
password",font=("cursive",30,'bold'),background='powder
blue',foreground='red')

label.place(x=105,y=15)

user=Label(rog,text='*User ID :',background='powder
blue',foreground='black',font=("cursive",12,'bold'))
user.place(x=40,y=95)

user = Label(rog, text='*New password :', background='powder blue',


foreground='black', font=("cursive", 12, 'bold'))

user.place(x=40, y=170)

e1 = Entry(rog, width=24, font=('arial', 9, 'bold'))

e1.place(x=190, y=95,width=250,height=30)

e2 = Entry(rog, width=24, font=('arial', 9, 'bold'))

e2.place(x=190, y=170,width=250,height=30)

def chan_pas():

a=e1.get()

b=e2.get()

conn=c.connect(host="localhost",user="root",password="",port="3306",
database="library_db")

cursor=conn.cursor()

cursor.execute("select * from admin where aid='"+a+"'")

#conn.commit()

data=cursor.fetchone()
if data!=None:

cursor=conn.cursor()

cursor.execute("update admin set password='"+b+ "' where


aid='"+a+"'")

conn.commit()

messagebox.showinfo("Library System","Your Password is


changed !",parent=rog)

rog.destroy()

else:

messagebox.showinfo("Library System","This Userid is not


requird",parent=rog)

#--------------------Submit Button------------------

s=Label(rog)

b=Button(rog,image=img)

img6=Image.open(r"C:\Users\hp\Desktop\Submit.png")

img6=img6.resize((150,40))

img6=ImageTk.PhotoImage(img6)

b.config(image=img6,cursor="hand2",command=chan_pas)

b.image=img6

b.place(x=170,y=240)

rog.mainloop()
#--------------------Change Password Button------------------

o1=Label(t)

b=Button(t,image=img)

img=Image.open(r"E:\forgotpass.png")

img=img.resize((380,45))

img=ImageTk.PhotoImage(img)

b.config(image=img,cursor="hand2",command=mouseClick)

b.image=img

b.place(x=600,y=730)

lg()
MAIN PAGE:-

from tkinter import *


from PIL import ImageTk,Image
from tkinter.ttk import *
import tkinter.ttk as ttk
import mysql.connector
import mysql.connector as c
from tkinter import messagebox
from datetime import *
import time
import calendar
from laddbook import *
from ldeletebook import *
from lviewbook import *
from lissuebook import *
from lreturnbook import *

#con =
c.connect(host="localhost",user="root",password="",port="3306",d
atabase=library_db)
#cur = con.cursor()
def main():
root = Toplevel()
root.title("Library Managment")
root.minsize(width=400,height=400)
root.geometry("1600x800+0+0")

l=Label(root)
img=Image.open(r"E:\LIB.jpg")
img=img.resize((1600,700))
img=ImageTk.PhotoImage(img)
l.config(image=img)
l.image=img
l.place(x=0,y=105)

titlelbl=Label(root,text="AI LIBRARY MANAGMENT


SYSTEM",font=("times now
roman",50,"bold"),justify=CENTER,background="black",foregroun
d="gold")
titlelbl.config(anchor=CENTER)
titlelbl.place(x=0,y=0,width=1600,height=120)

ll=Label(root)
img2=Image.open(r"C:\Users\hp\Desktop\logo6.png")
img2=img2.resize((200,100))
img2=ImageTk.PhotoImage(img2)
ll.config(image=img2)
ll.image=img2
ll.place(x=5,y=10,width=200,height=100)

headingFrame1 = Frame(root,bg="#FFBB00",bd=5)

headingFrame1.place(relx=0.2,rely=0.2,relwidth=0.6,relheight=0.1
6)
headingLabel = Label(headingFrame1, text="Welcome to \n AI
Library Managment System",justify=CENTER, bg='black',
fg='white', font=('Courier',20))
headingLabel.config(anchor=CENTER)
headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

btn1 = Button(root,text="Add Book Details",bg='black',


fg='white',command=addBook)
btn1.place(relx=0.28,rely=0.45, relwidth=0.45,relheight=0.1)

btn2 = Button(root,text="Delete Book",bg='black', fg='white',


command=deleteBook)
btn2.place(relx=0.28,rely=0.55, relwidth=0.45,relheight=0.1)

btn3 = Button(root,text="View Book List",bg='black',


fg='white',command=viewBook)
btn3.place(relx=0.28,rely=0.65, relwidth=0.45,relheight=0.1)

btn4 = Button(root,text="Issue Book to Student",bg='black',


fg='white',command=issueBook)
btn4.place(relx=0.28,rely=0.75, relwidth=0.45,relheight=0.1)
btn5 = Button(root,text="Return Book",bg='black',
fg='white',command=returnBook)
btn5.place(relx=0.28,rely=0.85, relwidth=0.45,relheight=0.1)

def clock():
h=str(time.strftime("%H"))
m=str(time.strftime("%M"))
s=str(time.strftime("%S"))

dd=str(time.strftime("%d"))
mm=int(time.strftime("%m"))
yy=int(time.strftime("%y"))

lbldate.config(text=dd)
lblmonth.config(text=str(mm))
lblyear.config(text=str(yy))

if int(h)>12 and int(m)>0:


lblnoon.config(text="PM")
if int(h)>12:
h=str((int(h)-12))
lblhr.config(text=h)
lblmin.config(text=m)
lblsec.config(text=s)
lblhr.after(200,clock)

lblhr=Label(root,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblhr.place(x=1260,y=120,width=60,height=40)

lbldate=Label(root,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")
lbldate.place(x=1260,y=170,width=60,height=40)

lblmin=Label(root,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmin.place(x=1330,y=120,width=60,height=40)

lblmonth=Label(root,text="Month",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmonth.place(x=1330,y=170,width=60,height=40)
lblsec=Label(root,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblsec.place(x=1400,y=120,width=60,height=40)

lblyear=Label(root,text="Year",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblyear.place(x=1400,y=170,width=60,height=40)

lblnoon=Label(root,text="AM",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblnoon.place(x=1470,y=120,width=60,height=40)

lblcurrent=Label(root,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblcurrent.place(x=1470,y=170,width=60,height=40)

clock()
root.mainloop()
ADD BOOK PAGE:-

from tkinter import *


from PIL import ImageTk,Image
from tkinter import messagebox
import mysql.connector
import mysql.connector as c

def bookRegister():

bid = bookInfo1.get()
title = bookInfo2.get()
author = bookInfo3.get()
status = bookInfo4.get()
status = status.lower()

insertBooks = "insert into books


values('"+bid+"','"+title+"','"+author+"','"+status+"')"
try:
cur.execute(insertBooks)
con.commit()
messagebox.showinfo('Success',"Book added
successfully",parent=root)
except:
messagebox.showinfo("Error","This book id is alreay
exits.",parent=root)

root.destroy()

def addBook():

global
bookInfo1,bookInfo2,bookInfo3,bookInfo4,Canvas1,con,cur,bookT
able,root
root = Toplevel()
root.title("Library")
#root.minsize(width=400,height=400)
root.geometry("600x500+480+290")

con =
c.connect(host="localhost",user="root",password="",port="3306",d
atabase="library_db")
cur = con.cursor()

Canvas1 = Canvas(root)

Canvas1.config(bg="DarkOrange1")
Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="#FFBB00",bd=5)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.
13)
headingLabel = Label(headingFrame1, text="Add Books",
bg='black', fg='white', font=('Courier',15))
headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root,bg='black')
labelFrame.place(relx=0.1,rely=0.4,relwidth=0.8,relheight=0.4)

# Book ID
lb1 = Label(labelFrame,text="Book ID : ", bg='black', fg='white')
lb1.place(relx=0.05,rely=0.2, relheight=0.08)

bookInfo1 = Entry(labelFrame)
bookInfo1.place(relx=0.3,rely=0.2, relwidth=0.62,
relheight=0.08)

# Title
lb2 = Label(labelFrame,text="Title : ", bg='black', fg='white')
lb2.place(relx=0.05,rely=0.35, relheight=0.08)

bookInfo2 = Entry(labelFrame)
bookInfo2.place(relx=0.3,rely=0.35, relwidth=0.62,
relheight=0.08)

# Book Author
lb3 = Label(labelFrame,text="Author : ", bg='black', fg='white')
lb3.place(relx=0.05,rely=0.50, relheight=0.08)

bookInfo3 = Entry(labelFrame)
bookInfo3.place(relx=0.3,rely=0.50, relwidth=0.62,
relheight=0.08)

# Book Status
lb4 = Label(labelFrame,text="Status(Avail/issued) : ",
bg='black', fg='white')
lb4.place(relx=0.05,rely=0.65, relheight=0.08)

bookInfo4 = Entry(labelFrame)
bookInfo4.place(relx=0.3,rely=0.65, relwidth=0.62,
relheight=0.08)

#Submit Button
SubmitBtn = Button(root,text="SUBMIT",bg='#d1ccc0',
fg='black',command=bookRegister)
SubmitBtn.place(relx=0.28,rely=0.9,
relwidth=0.18,relheight=0.08)

quitBtn = Button(root,text="Quit",bg='#f7f1e3', fg='black',


command=root.destroy)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)

root.mainloop()
#addBook()
DELETE BOOK:-

from tkinter import *


from PIL import ImageTk,Image
from tkinter import messagebox
import mysql.connector
import mysql.connector as c

con =
c.connect(host="localhost",user="root",password="",port="3306",d
atabase="library_db")
cur = con.cursor()
def deletebook():

bid = bookInfo1.get()

deleteSql = "delete from books where bid = '"+bid+"'"


deleteIssue = "delete from issuedbooks where bid = '"+bid+"'"
try:
cur.execute(deleteSql)
con.commit()
cur.execute(deleteIssue)
con.commit()
messagebox.showinfo('Success',"Book Record Deleted
Successfully",parent=root)
except:
messagebox.showinfo("Invalid Book ID",parent=root)

bookInfo1.delete(0, END)
root.destroy()

def deleteBook():
global
bookInfo1,bookInfo2,bookInfo3,bookInfo4,Canvas1,con,cur,bookT
able,root

root = Toplevel()
root.title("Library")
#root.minsize(width=400,height=400)
root.geometry("600x500+480+290")

Canvas1 = Canvas(root)

Canvas1.config(bg="DarkOrange1")
Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="#FFBB00",bd=5)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.
13)

headingLabel = Label(headingFrame1, text="Delete Book",


bg='black', fg='white', font=('Courier',15))
headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root,bg='black')
labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)

# Book ID to Delete
lb2 = Label(labelFrame,text="Book ID : ", bg='black', fg='white')
lb2.place(relx=0.05,rely=0.5)

bookInfo1 = Entry(labelFrame)
bookInfo1.place(relx=0.3,rely=0.5, relwidth=0.62)

#Submit Button
SubmitBtn = Button(root,text="SUBMIT",bg='#d1ccc0',
fg='black',command=deletebook)
SubmitBtn.place(relx=0.28,rely=0.9,
relwidth=0.18,relheight=0.08)

quitBtn = Button(root,text="Quit",bg='#f7f1e3', fg='black',


command=root.destroy)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
VIEW BOOK:-

from tkinter import *


from PIL import ImageTk,Image
from tkinter import messagebox
import mysql.connector
import mysql.connector as c

con =
c.connect(host="localhost",user="root",password="",port="3306",d
atabase="library_db")
cur = con.cursor()
def viewBook():

root = Toplevel()
root.title("Library")
#root.minsize(width=400,height=400)
root.geometry("600x500+480+290")

Canvas1 = Canvas(root)
Canvas1.config(bg="DarkOrange1")
Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="#FFBB00",bd=5)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.
13)

headingLabel = Label(headingFrame1, text="View Books",


bg='black', fg='white', font=('Courier',15))
headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)
labelFrame = Frame(root,bg='black')
labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)
y = 0.25

Label(labelFrame, text="%-10s%-40s%-30s%-
20s"%('BID','Title','Author','Status'),bg='black',fg='white').place(rel
x=0.07,rely=0.1)
Label(labelFrame, text="---------------------------------------------------
-------------------------
",bg='black',fg='white').place(relx=0.05,rely=0.2)
getBooks = "select * from books"
cur.execute(getBooks)
for i in cur:
Label(labelFrame, text="%-10s%-40s%-30s%-
20s"%(i[0],i[1],i[2],i[3]),bg='black',fg='white').place(relx=0.07,rely=y
)
y += 0.1

quitBtn = Button(root,text="Quit",bg='#f7f1e3', fg='black',


command=root.destroy)
quitBtn.place(relx=0.4,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
ISSUE BOOK:-

from tkinter import *


from PIL import ImageTk,Image
from tkinter import messagebox
import mysql.connector
import mysql.connector as c

con =
c.connect(host="localhost",user="root",password="",port="3306",d
atabase="library_db")
cur = con.cursor()
#List To store all Book IDs
allBid = []

def issue():
global
issueBtn,labelFrame,lb1,inf1,inf2,quitBtn,root,Canvas1,status
bid = inf1.get()
issueto = inf2.get()

issueBtn.destroy()
labelFrame.destroy()
lb1.destroy()
inf1.destroy()
inf2.destroy()

extractBid = "select bid from books"


try:
cur.execute(extractBid)
for i in cur:
allBid.append(i[0])
if bid in allBid:
checkAvail = "select status from books where bid =
'"+bid+"'"
cur.execute(checkAvail)
for i in cur:
check = i[0]

if check == 'avail':
status = True
else:
status = False

else:
messagebox.showinfo("Error","Book ID not
present",parent=root)
except:
messagebox.showinfo("Error","Can't fetch Book
IDs",parentroot)

issueSql = "insert into issuedbooks values


('"+bid+"','"+issueto+"')"
show = "select * from issuedbooks"

updateStatus = "update books set status = 'issued' where bid =


'"+bid+"'"
try:
if bid in allBid and status == True:
cur.execute(issueSql)
con.commit()
cur.execute(updateStatus)
con.commit()
messagebox.showinfo('Success',"Book Issued
Successfully",parent=root)
root.destroy()
else:
allBid.clear()
messagebox.showinfo('Message',"Book Already
Issued",parent=root)
root.destroy()
return
except:
messagebox.showinfo("Search Error","The value entered is
wrong, Try again",parent=root)
#print(bid)
#print(issueto)

allBid.clear()

def issueBook():

global
issueBtn,labelFrame,lb1,inf1,inf2,quitBtn,root,Canvas1,status

root = Tk()
root.title("Library")
#root.minsize(width=400,height=400)
root.geometry("600x500+480+290")

Canvas1 = Canvas(root)
Canvas1.config(bg="DarkOrange1")
Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="#FFBB00",bd=5)
headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.
13)

headingLabel = Label(headingFrame1, text="Issue Book",


bg='black', fg='white', font=('Courier',15))
headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root,bg='black')
labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)

# Book ID
lb1 = Label(labelFrame,text="Book ID : ", bg='black', fg='white')
lb1.place(relx=0.05,rely=0.2)

inf1 = Entry(labelFrame)
inf1.place(relx=0.3,rely=0.2, relwidth=0.62)

# Issued To Student name


lb2 = Label(labelFrame,text="Issued To : ", bg='black',
fg='white')
lb2.place(relx=0.05,rely=0.4)
inf2 = Entry(labelFrame)
inf2.place(relx=0.3,rely=0.4, relwidth=0.62)
#Issue Button
issueBtn = Button(root,text="Issue",bg='#d1ccc0',
fg='black',command=issue)
issueBtn.place(relx=0.28,rely=0.9,
relwidth=0.18,relheight=0.08)

quitBtn = Button(root,text="Quit",bg='#aaa69d', fg='black',


command=root.destroy)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)

root.mainloop()
RETURN BOOK:-

from tkinter import *


from PIL import ImageTk,Image
from tkinter import messagebox
import mysql.connector
import mysql.connector as c

con =
c.connect(host="localhost",user="root",password="",port="3306",d
atabase="library_db")
cur = con.cursor()

allBid = [] #List To store all Book IDs

def returnn():

global
SubmitBtn,labelFrame,lb1,bookInfo1,quitBtn,root,Canvas1,status

bid = bookInfo1.get()

extractBid = "select bid from issuedbooks"


try:
cur.execute(extractBid)
for i in cur:
allBid.append(i[0])

if bid in allBid:
checkAvail = "select status from books where bid =
'"+bid+"'"
cur.execute(checkAvail)
for i in cur:
check = i[0]

if check == 'issued':
status = True
else:
status = False

else:
messagebox.showinfo("Error","Book ID not
present",parent=root)
except:
messagebox.showinfo("Error","Can't fetch Book
IDs",parent=root)

issueSql = "delete from issuedbooks where bid = '"+bid+"'"

#print(bid in allBid)
#print(status)
updateStatus = "update books set status = 'avail' where bid =
'"+bid+"'"
try:
if bid in allBid and status == True:
cur.execute(issueSql)
con.commit()
cur.execute(updateStatus)
con.commit()
messagebox.showinfo('Success',"Book Returned
Successfully",parent=root)
else:
allBid.clear()
messagebox.showinfo('Message',"Please check the book
ID",parent=root)
root.destroy()
return
except:
messagebox.showinfo("Search Error","The value entered is
wrong, Try again",parent=root)

allBid.clear()
root.destroy()

def returnBook():

global
bookInfo1,SubmitBtn,quitBtn,Canvas1,con,cur,root,labelFrame,
lb1

root = Tk()
root.title("Library")
#root.minsize(width=400,height=400)
root.geometry("600x500+480+290")
Canvas1 = Canvas(root)

Canvas1.config(bg="DarkOrange1")
Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="#FFBB00",bd=5)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.
13)

headingLabel = Label(headingFrame1, text="Return Book",


bg='black', fg='white', font=('Courier',15))
headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root,bg='black')
labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)

# Book ID to Delete
lb1 = Label(labelFrame,text="Book ID : ", bg='black', fg='white')
lb1.place(relx=0.05,rely=0.5)

bookInfo1 = Entry(labelFrame)
bookInfo1.place(relx=0.3,rely=0.5, relwidth=0.62)

#Submit Button
SubmitBtn = Button(root,text="Return",bg='#d1ccc0',
fg='black',command=returnn)
SubmitBtn.place(relx=0.28,rely=0.9,
relwidth=0.18,relheight=0.08)

quitBtn = Button(root,text="Quit",bg='#f7f1e3', fg='black',


command=root.destroy)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)

root.mainloop()
CONCLUSION

The purpose of face recognition attendance management


system is to identify students. In past years this process is
carried out by humans. This process gives the exact image
of the student but it is very difficult to identify the student
details and also it requires much amount of human
burden.
The main aim of our project is to over come
the drawbacks of human based system by using the
machine-based face identification process. In this process
we store the details of student into the database along
with his photo or image. Then we make the image into
different clips containing hair, forehead, eyes, nose, lips
and chin and store these clips into the database. When any
duplication occurs, we compare the details given by the
eyewitness with the clips already stored in the database
and we will identify the student. This project can be
extended to adjust the gaps between the clips after
construction of the image to be a perfect photograph using
Image processing Techniques.
SUMMARY
A library management system is software that is designed
to manage all the functions of a library. It helps librarian to
maintain the database of new books and the books that
are borrowed by members along with their due dates.
This system completely automates all your library’s
activities. The best way to maintain, organize, and handle
countless books systematically is to implement a library
management system software.
A library management system is used to maintain library
records. It tracks the records of the number of books in the
library, how many books are issued, or how many books
have been returned or renewed or late fine charges, etc.
You can find books in an instant, issue/reissue books
quickly, and manage all the data efficiently and orderly
using this system. The purpose of a library management
system is to provide instant and accurate data regarding
any type of book, thereby saving a lot of time and effort.
BIBLIOGRAPHY
BOOKS REFERRED

The following books were used extensively for the project


development and implementation.

 Downey, Allen B. (May 2012). Think Python: How


to Think Like a Computer Scientist (Version
1.6.6 ed.).
 Lutz, Mark (2013). Learning Python (5th ed.).
O'Reilly Media.
 Pilgrim, Mark (2009). Dive into Python 3. Apress.
 Summerfield, Mark (2009). Programming in
Python 3 (2nd ed.). Addison-Wesley Professional
WEBSITES REFERRED

The following links were searched and exploited


extensively for the project development and
implementation.

1. https://www.python.org/
2.https://www.w3schools.com/python/python_intro.a
sp
3.https://www.geeksforgeeks.org/python-
programming-language/

You might also like