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

kartik ip project

Uploaded by

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

kartik ip project

Uploaded by

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

पीएम श्री केंद्रीय विद्यालय क्रमांक २

जम्मू छावनी

PM Shri, Kendriya Vidyalaya No 2 Jammu


Cantt

Informatics Practices Project On -

LIBRARY
MANAGEMENT
SYSTEM

SUBMITTED BY:
Kartik Pandita
Class: - XII - B
Roll. No.: - 13

ACKNOWLEDGEMENT
I would want to sincerely thank Kendriya Vidyalaya
No. 2 Jammu Cantt for giving the facilities needed to
finish this project.
I want to thank my teacher Varsha Sharma from the
bottom of my heart for helping me with the project and
correcting me when I needed it. She was always really
interested in what I did. Her helpful suggestions and
unwavering encouragement have been the driving
forces behind my project's successful conclusion.
I also want to express my gratitude to my parents and
friends for their unwavering support, encouragement,
and assistance.

Student Signature Teacher’s Signature


INDEX

CONTENTS PAGE
NO.
INTRODUCTION TO THE 3
PROJECT
FILES, LIBRARIES, TABLES 4
AND DATABASES
SOURCE CODE
 1)CONTENT 8
EXPLANATION 9
 2) PROGRAM CODE

SCREENSHOTS 21
BIBLIOGRAPHY 24
INTRODUCTION TO THE
PROJECT:
The "ANsi" project is a library management system software that allows
books to be borrowed and donated globally. The project is created using
MySQL and Python IDLE.

This software's primary functions include updating user databases,


adding new users, keeping track of books, determining whether a
book is available for rental, and providing alternative options, like
book donations, if it is not.

MySQL databases are used to store the book details, usernames,


and passwords. Python IDLE is used to access the databases. An
interface between the user and the databases is provided by Python
IDLE.
FILES, LIBRARIES, TABLES AND
DATABASES:

PYMYSQL: This client library is exclusively for Python and


MySQL: It is utilised in this project to link Python and MySQL.
ANSI: The database used to generate the many tables utilised in
this project is called "Ansi." This database contains the tables
"login" and "books."
LOGIN: The table "login" holds the passwords and login IDs of
various clients.
"Id," "loginId," and "password" are the three columns that make up
"login."
"loginId": holds the consumer’s login credentials.
"password": keeps track of client passwords.
BOOKS: ‘books’ is the table which contains the list of books
which are available.
‘books’ has thirteen columns ‘bookId’, ’bookName’, ’bookAuthor’,
’journalCategory’, ‘journalSubCategory’, ‘s1’, ‘s2’, ‘s3’, ‘s4’, ‘s5’,
‘s6’, ‘s7’, ‘s8’.
‘bookId’: stores the codes for the books.
‘bookName’: stores the names of the books.
‘bookAuthor’: stores the author’s name.
‘journalCategory’: contains all the categories of genres
available.
‘journalSubCategory’: contains all the sub categories for the
genres.
‘s1’, ‘s2’, ‘s3’, ‘s4’, ‘s5’, ‘s6’, ‘s7’, ‘s8’: store the information
about slots.
SOURCE CODE:
CONTENT EXPLANATION:
First the user must enter his/her username.
If the user is a registered user the he/she must enter his/her
password. If not, then the user must create an account in
‘ANsi library.’
Next a message is displayed which says ‘successfully logged
in’ and the user is asked to choose a genre - ‘Fiction’ or
‘Nonfiction’. The user must type the number corresponding
to the chosen genre.
Under each genre there are sub categories like horror,
comedy, sci-fi etc.
After choosing a subcategory and a book in the respective
subcategory a message is displayed which says ‘which slot
would you prefer? ‘And the user is provided with many time
slot options in which the user is required to select one time
slot for borrowing books and returning the book at the end
of the time slot. If the slot is available for booking then
booking takes place or else an error message is displayed
which says ‘Sorry this slot has been taken by someone else.’
After booking a message is displayed which says
‘successfully booked.’
The user is also given an option if he or she wants to donate
books. The usernames, passwords, book details and slot
details are stored in different tables in ‘ANsi’ database in
‘MySQL’. Book booking is done using Python code which
accesses all tables in ‘ANsi’ database.
PROGRAM CODE:
Python code:
import pymysql
conn=pymysql.connect(host='localhost',user='root',password='tiger',database='A
Nsi')
#put password of your mysql
h=conn.cursor()
z="\""
print('*************** Welcome to ANsi library******************')
uid=input('Enter your username: ')
pw=input('Enter your password: ')
h.execute("select count(id) from login where loginId like "+z+uid+z+" && password
like"+z+pw+z+";")
count=h.fetchone()
if count==(1,):
print("********************Successfully logged in**************")
else:
d=input("Invalid username or password. press x to exit: ")
if d=='x':
exit()
print('which one would you prefer?')
g1=int(input('Please enter 1 for fiction and 2 for non fiction : '))
if g1==2:
print('1.Biography\n 2.History')
if g1==1:
print('1.Horror\n2.Sci-Fi\n3.Thriller\n4.Romance\n5.Murder and Detective')
g2=input("Enter the genre of your choice : ")
h.execute("select bookId , bookName from books where journalSubCategory
like \""+g2+"\";")
book=h.fetchall()
print('Book-id\t\tBook Name')
for i in book:
for j in i:
print (j,end='\t\t')
print()

while (1):
id=input('\nEnter book id:')
h.execute("select count(*) from books where bookId ="+id)
c=h.fetchone()
if c==(1,):
break
else:
print("Book is not available!!\n")
d=input("press 1 to try again and x to exit: ")
if d=='x':
exit()
print("The slots available are")
print("\nslot-1(s1)\nslot-2(s2)\nslot-3(s3)\nslot-4(s4)\nslot-5(s5)\nslot-6(s6)\nslot-7(s7)\
nslot-8(s8)\n")
while(1):
sl=input('Choose your comfortable slot: ')
h.execute("select count(*) from books where bookId="+id+" and "+sl+" is null;")
count=a.fetchone()
if count==(1,):
con=input('Your book is available in your selected slot. \n\nDo you want to
confirm your booking?\nEnter \'yes\' to proceed with your booking\nEnter \'no\' to cancel
your booking: ')
if con=='yes':
print('\nYour booking has been confirmed.\nYou can collect your book at your
nearest store. For further details contact your nearest store.')
h.execute('update books set '+sl+'=1 where bookId='+id+';')
break
elif count==(0,):
s=input("Sorry!! slot is already booked.\n Do you want to check the
availability of another slot?(y/n))")
if s== "y" :
continue
else:
break

print('************Thank You for visiting our online website *********')


MYSQL CODE:
show databases;
create database ANsi;
use ANsi;
CREATE TABLE login (
`Id` int DEFAULT NULL,
`loginId` varchar(20) DEFAULT NULL,
`password` varchar(30) DEFAULT NULL
);
INSERT INTO login VALUES (1,'mehak','wo2lg');
INSERT INTO login VALUES (2,'jatin','kamm4m');
INSERT INTO login VALUES (3,'laksh','wel5');
INSERT INTO login VALUES (4,'Neha','boomboom3');
INSERT INTO login VALUES (5,'kartik','welcome1');
INSERT INTO login VALUES (6,'rishav','welcome1');
INSERT INTO login VALUES (7,'ash','dishum8');
INSERT INTO login VALUES (8,'bebo','wisdom7');
INSERT INTO login VALUES (9,'usmaan','dhishkiyaun11');

CREATE TABLE books (bookId int, bookName varchar(50),


bookAuthor varchar(30), journalCategory varchar(30),
journalSubCategory varchar(30),s1 int, s2 int, s3 int, s4 int,
s5 int, s6 int, s7 int, s8 int);
#Thriller
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory )
values (1,'Woman in White','Josh Hazlewood', 'Fiction','Thriller');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory )
values (2,'Men in Black', 'Mitchell Starc', 'Fiction','Thriller');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory )
values (3,'Dan Code','Pat Cummins', 'Fiction','Thriller');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory )
values (4,'The Women in the Brain','Scott Boland',
'Fiction','Thriller');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory )
values (5,'A minute to mideast','Brett Lee', 'Fiction','Thriller');
#Horror
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (6,'19 November','Travis Head', 'Fiction','Horror');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (7,'19 Nov','Marnus Labuschagne', 'Fiction','Horror');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (8,'The Bloody Eyes','David Warner', 'Fiction','Horror');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (9,'BGT','Pat Cummins', 'Fiction','Horror');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (10,'Come to me','Mitchell Marsh', 'Fiction','Horror');

# MurderAndDetective
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (11,'Murder of Dreams','Travis Head',
'Fiction','MurderAndDetective');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (12,'Death on Cricket','Australia',
'Fiction','MurderAndDetective');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (13,'Sad Story','Steve Smith',
'Fiction','MurderAndDetective');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (14,'Taken at the Breath','Glenn Maxwell',
'Fiction','MurderAndDetective');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (15,'Still lake','Marcus Stoinis',
'Fiction','MurderAndDetective');
# sci-Fi
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (16,'Ironman','Tony Stark', 'Fiction','Sci-Fi');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (17,'Hulk','Bruce Banner', 'Fiction','Sci-Fi');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (18,'Black Widow','Natasha', 'Fiction','Sci-Fi');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (19,'Captain America','Steve Roger', 'Fiction','Sci-Fi');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (20,'InRobot','Isaac Asimov', 'Fiction','Sci-Fi');

# Biography
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (21,'Steve Jobs','Walter Isacson', 'Non-Fiction','Biography');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (22,'The diary of the young girl','Anne Frank', 'Non-
Fiction','Biography');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (23,'I am Malala','Malala yousafzai','Non-
Fiction','Biography');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (24,'Becoming','Michelle obama', 'Non-Fiction','Biography');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (25,'Educated','Tara Westover', 'Non-Fiction','Biography');
# History
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (26,'Oscar:A life','Mathew Sturgis', 'Non-Fiction','History');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (27,'Express:Queen Victoria and India','Miles Tailor', 'Non-
Fiction','History');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (28,'Birds in the ancient world','Jeremy Mynott','Non-
Fiction','History');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (29,'Building Anglosascor England','John Blair', 'Non-
Fiction','History');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (30,'The guns of August','Barbara w.Tuchman', 'Non-
Fiction','History');

# Romance
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (31,'Pride and Prejustice','Jane Austen', 'Fiction','Romance');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (32,'Fault in our stars','John green', 'Fiction','Romance');
insert into books (bookId , bookName, bookAuthor ,
journalCategory , journalSubCategory)
values (33,'Will grayson','John green','Fiction','Romance');
SCREENSHOTS of Code

When Password or Username is invalid


Bibliography:
1. Informatics Practices (A textbook for class 12) by Sumita
Arora
2. Informatics Practices (A textbook for class 11) by Sumita
Arora
3. www.google.com
4. Wikipedia
5. https://www.python.org/downloads
6. https://www.mysql.com/downloads
7. https://www.w3schools.com/

You might also like