Library Management Python
Library Management Python
Acknowledgment
2. Introduction to Python
3. Introduction to Project
4. Source Code
5. Output
6. Hardware & Software
Requirements
7. Bibliography
CERTIFICATE
This is to certify that Kunal Kumar
Sonkar of Std. XII-‘B’ has completed the
computer project on ‘Book Shop
Management System’ under the
guidance of his computer teacher Mr.
Maninder Singh.
………………………. ……………………….
Signature of Internal Signature of External
……………………………..
Signature of Principal
ACKNOWLEDGEMENT
5. Large standard library: Python comes with a large standard library that
has some handy codes and functions which we can use while writing code in
Python.
6. Supports exception handling: If you are new, you may wonder what an
exception is. An exception is an event that can occur during a program
exception and can disrupt the normal flow of a program. Python supports
exception handling which means we can write less error-prone code and can
test various scenarios that can cause an exception later on.
INTRODUCTION TO THE
PROJECT…
Book shop management system is a python and SQL based project.
This system is developed to manage the sales and inventory of books
in any book shop. It is used by shopkeepers to manage their store
using a computerized system. The system was developed and
designed to help the shopkeeper record every book purchase and keep
the inventory updated.
This program can help a shopkeeper to manage his Book Store more
conveniently and efficiently as compared to those without
computerized system.
Source code:
#BOOK-MANAGEMENT_SYSTEM
#IMPORTING sqlite3 PREBUILT LIBRARY IN THE PROJECT
import sqlite3
sql_connect = sqlite3.connect('bookmanagement.db')
cursor = sql_connect.cursor()
t=0
#To check if the tables exist or not and the accordingly create them if they don't
exist
try:
query = "SELECT * FROM bookdetails"
cursor.execute(query).fetchone
except:
create = "CREATE TABLE bookdetails (b_id int NOT NULL PRIMARY KEY,b_name
varchar(255) NOT NULL,author varchar(255), publication varchar(255), ISBN
int,price int, quantity int)"
cursor.execute(create)
try:
query2 = 'SELECT * FROM customerdetails'
cursor.execute(query2).fetchone
except:
createCust = "CREATE TABLE customerdetails (c_id int NOT NULL PRIMARY
KEY,c_name varchar(255) NOT NULL,c_address varchar(255), c_phone
varchar(10))"
cursor.execute(createCust)
try:
query3 = 'SELECT * FROM sales'
cursor.execute(query3).fetchone
except:
cursor.execute("CREATE TABLE sales (t_id int NOT NULL PRIMARY KEY, c_id int
NOT NULL, b_id int NOT NULL, date DATE NOT NULL, quantity int NOT NULL,
total_price int NOT NULL)")
def bookmenu():
#book details menu
print('Book Menu')
print('1.) Add a book')
print('2.) Update a book')
print('3.) Delete a book')
print('4.) search')
print('5.) Display all')
c = int(input("enter your choice\t"))
#adding a book
if(c==1):
b_id= int(input('Enter the book ID\t'))
b_name= input('Enter Name of the book\t')
author= input('Enter Author Name\t')
publication = input('Enter the name of the Publication\t')
isbn = int(input('Enter the ISBN code of book'))
price = int(input('Enter the price of book\t'))
qty = int(input('Enter the Quantity of books\t'))
while(t!=1):
#main menu
print("Main Menu")
print('1.) Book Details')
print('2.) Customer Details')
print('3.) Sales Menu')
print('4.) exit')
ch = int(input("Enter your choice\t"))
if(ch==1):
bookmenu()
elif(ch==2):
cMenu()
elif(ch==3):
sMenu()
elif(ch==4):
break
else:
print('please select a valid option')
OUTPUT SCREENS:
Development
Environment
Software:
1) Operating System (Windows 8 or later) : Windows 8 is selected as
my operating system because of additional file system, improved
performance on multi-core processors, improved boot performances,
security features and better GUI.
Hardware:
1) Processor: Intel i3 or AMD Ryzen processor
*codereview.stackexchange.com
*fullstackpython.com
Thank You