Information practices project file on python
Information practices project file on python
Roll no:
CERTIFICATE
CLASS: XII YEAR: 2022-2023
4. Advantages of Project
5. Limitations of Project
7. Output Screens
9. Bibliography
BRIEF OVERVIEW OF PROJECT..
The main objective of the python project on fashion store
management is to manage the details of sales, discounts, payments,
products, and inventory digitally.
It tracks all the details about stocks, products, and inventory; it also
prints various reports as per input given by the user.
Data file handling has been effectively used in the program. The
database is a collection of interrelated data to serve multiple
applications. That is database programs create files of information. So
we see that files are worked with most, inside the program.
DBMS: The software required for the management of data is called as
DBMS. It has3 models:
• Relation model
• Hierarchical model
• Network model
CHARACTERISTICS OF DBMS:
• Data sharing
• Data standardization
• Sequential file
• Serial file
• Text file
• Binary File
NEED OF COMPUTERISATION
Over the decades computers and fashion have developed gradually,
changed with time, taste and trend. But nobody knew that a time will
come when both these fields will complement each other so well.
Today fashion design has reached new heights by computer aided
methods of design. As a result of which, computer industry has got its
new customer. Computer technology is making waves in the fashion
design zone. From determining textile weaves to sizing designs;
computers are a vital component of the fashion industry. Computer
aided design (CAD) programs reduce the demand for manual
sketches. New software programs continue to replace old manual
skills. Going by the wayside are "old fashioned" flat pattern
construction, pencil sketching and traditional math-based pattern
sizing. Those who lag in math and falter at sketching can now breathe
a little easier.Manually figuring size adjustments and cutting pattern
pieces instils that knowledge. Software programs constantly evolve. A
program used today may be obsolete within several years. Being
trained on today's software does not guarantee it will be used when
you are ready to go out into the field. Understanding calculations is
timeless, as is computer competency. Software, however, shifts
rapidly.
1. It generates the report on sales, discounts and stocks.
2. Provides filter report on payments, inventory and products.
3. We can easily export PDF on sales, products and stocks.
4. Applications can also provide excel export for sales and
discounts.
5. It deals with monitoring the information and transaction of
products.
6. It increases the efficiency of managing sales and discount.
7. It has higher efficiency of editing, adding and updating of
records.
8. Provides the searching facilities on various factors.
1. Excel export has not been developed for stocks and products.
2. The transactions are executed in offline mode only.
3. Online transactions for sales, discounts, or other data
modifications are not possible.
4. Offline reports of sales, products, discounts and stocks cannot be
generated due to batch mode execution.
Source code Screening…
DBMS: MySQL
Host: local host
User: root
Pass: root
Database: fashion
Table Structure: (Images Bellow)
1. Product table
2. Purchase table
4. Purchase table
mydb=mysql.connector.connect(host="localhost",\
user="root",\
passwd="root",\
database="fashion")
mycursor=mydb.cursor()
defAddProduct():
L=[]
stk=[]
pid=input("Enter the Product ID : ")
L.append(pid)
IName=input("Enter the Product Name : ")
L.append(IName)
brnd=input("Enter the Product Brand Name : ")
L.append(brnd)
fr=input("Enter Male/Female/Kids : ")
L.append(fr)
sn=input("Enter Winter/Summer : ")
L.append(sn)
rate=int(input("Enter the Rates for Product :"))
L.append(rate)
product=(L)
sql="Insert into product
(product_id,PName,brand,Product_for,Season,rate)values(%s,%s,%s,%s,%s,%s)"
mycursor.execute(sql,product)
mydb.commit()
stk.append(pid)
stk.append(0)
stk.append("No")
st=(stk)
sql="insert into stock(item_id, Instock, status) values(%s,%s,%s)"
mycursor.execute(sql,st)
mydb.commit()
print("One Product inserted ")
defEditProduct():
pid=input("Enter product ID to be edited : ")
sql="select * from product where product_id=%s"
ed=(pid,)
mycursor.execute(sql,ed)
res=mycursor.fetchall()
for x in res:
print(x)
print("")
fld=input("Enter the field which you want to edit : ")
val=input("Enter the value you want to set : ")
sql="Update product set " + fld +"='" + val + "' where product_id='" + pid + "'"
sq=sql
mycursor.execute(sql)
print("Editing Don : ")
print("After correction the record is : ")
sql="select * from product where product_id=%s"
ed=(pid,)
mycursor.execute(sql,ed)
res=mycursor.fetchall()
for x in res:
print(x)
mydb.commit()
defDelProduct():
pid=input("Enter the Product)id to be deleted : ")
sql="delete from sales where item_id=%s"
id=(pid,)
mycursor.execute(sql,id)
mydb.commit()
sql="delete from purchase where item_id=%s"
mycursor.execute(sql,id)
mydb.commit()
sql="delete from stock where item_id=%s"
mycursor.execute(sql,id)
mydb.commit()
sql="delete from product where product_id=%s"
mycursor.execute(sql,id)
mydb.commit()
print("One Item Deleted")
defViewProduct():
print("Display Menu: Select the category to display the data")
print("1. All Details")
print("2. Product Name:")
print("3. Product Brand:")
print("4. Product For:")
print("5. Product Season:")
print("6. Product ID:")
x=0
ch=int(input("Enter your choice to display : "))
if ch==1:
sql="select * from product"
mycursor.execute(sql)
res=mycursor.fetchall()
for x in res:
print(x)
x=1
elifch==2:
var='PName'
val=input("Enter the name of Product : ")
elifch==3:
var='brand'
val=input("Enter the name of Brand : ")
elifch==4:
var='Product_for'
val=input("Enter Male/Femal/Kids : ")
elifch==5:
var='season'
defPurchaseProduct():
mn=""
dy=""
now=datetime.datetime.now()
purchaseID="P"+str(now.year)+str(now.month)+str(now.day)+str(now.hour)+str(now.min
ute)+str(now.second)
L=[]
Lst=[]
L.append(purchaseID)
itemId=input("Enter Product ID : ")
L.append(itemId)
itemNo=int(input("Enter the number of Items : "))
L.append(itemNo)
sql="select rate from product where product_id=%s"
pid=(itemId,)
mycursor.execute(sql,pid)
res=mycursor.fetchone()
for x in res:
print("rate is : ", x)
amount=x*itemNo
print("Amount is :", amount)
L.append(amount)
mnth=now.month
if mnth<=9:
mn="0"+str(mnth)
else:
mn=str(mnth)
day=now.day
if day<=9:
dy="0"+str(day)
else:
dy=str(day)
dt=str(now.year)+"-"+mn+"-"+dy
L.append(dt)
tp=(L)
sql="insert into
purchase(purchase_id,item_id,no_of_items,amount,Purchase_date)values(%s,%s,%s,
%s,%s)"
mycursor.execute(sql,tp)
mydb.commit()
sql="Select Instock from stock where item_id=%s"
mycursor.execute(sql,pid)
res=mycursor.fetchall()
status="No"
for x in res:
print(x)
instock=x[0]+itemNo
if instock>0:
status="Yes"
Lst.append(instock)
Lst.append(status)
Lst.append(itemId)
tp=(Lst)
sql="update stock set instock=%s,status=%s where item_id=%s"
mycursor.execute(sql,tp)
mydb.commit()
print("1 Item purchased and saved in Database")
defViewPurchase():
item=input("Enter Product Name : ")
sql="select product.product_id,
product.PName,product.brand,purchase.no_of_items,purchase.purchase_date,purchase.a
mount from product INNER JOIN purchase ON product.product_id=purchase.item_id and
product.PName=%s"
itm=(item,)
mycursor.execute(sql,itm)
res=mycursor.fetchall()
for x in res:
print(x)
defViewStock():
item=input("Enter Product Name : ")
sql="select product.product_id,product.PName,stock.Instock,\
stock.status from stock, product where \
product.product_id=stock.item_id and product.PName=%s"
itm=(item,)
mycursor.execute(sql,itm)
res=mycursor.fetchall()
for x in res:
print(x)
defSaleProduct():
now=datetime.datetime.now()
saleID="S"+str(now.year)+str(now.month)+str(now.day)+str(now.hour)+str(now.minute)+
str(now.second)
L=[]
L.append(saleID)
itemId=input("Enter Product ID : ")
L.append(itemId)
itemNo=int(input("Enter the number of Items : "))
L.append(itemNo)
sql="select rate from product where product_id=%s"
pid=(itemId,)
mycursor.execute(sql,pid)
res=mycursor.fetchall()
for x in res:
print("The rate of item is :",x)
dis=int(input("Enter the discount : "))
saleRate=x[0]-(x[0]*dis/100)
L.append(saleRate)
amount=itemNo*saleRate
L.append(amount)
mnth=now.month
if mnth<=9:
mn="0"+str(mnth)
else:
mn=str(mnth)
day=now.day
if day<=9:
dy="0"+str(day)
else:
dy=str(day)
dt=str(now.year)+"-"+mn+"-"+dy
L.append(dt)
tp=(L)
sql="insert into sales (sale_id, item_id,no_of_item_sold,\
sale_rate,amount,date_of_sale) values(%s,%s,%s,%s,%s,%s)"
mycursor.execute(sql,tp)
mydb.commit()
sql="Select Instock from stock where item_id=%s"
mycursor.execute(sql,pid)
res=mycursor.fetchall()
for x in res:
print("Total Items in Stock are : ",x)
instock=x[0]-itemNo
if instock>0:
status="Yes"
tp=(instock,status,itemId)
sql="update stock set instock=%s,status=%s where item_id=%s"
print("Remaining Items in Stock are : ",instock)
mycursor.execute(sql,tp)
mydb.commit()
def ViewSales():
item=input("Enter Product Name : ")
sql="select product.product_id, product.PName,product.brand,\
sales.no_of_item_sold,sales.date_of_sale,sales.amount \
from sales, product where product.product_id=sales.item_id \
and product.PName=%s"
itm=(item,)
mycursor.execute(sql,itm)
res=mycursor.fetchall()
for x in res:
print(x)
MenuSet()
def runAgain():
runAgn = input("\nwant To Run Again Y/n: ")
while(runAgn.lower() == 'y'):
if(platform.system() == "Windows"):
print(os.system('cls'))
else:
print(os.system('clear'))
MenuSet()
runAgn = input("\nwant To Run Again Y/n: ")
runAgain()
Output of code… :
Main menu:
Add product:
Edit product:
Delete product:
View product:
Purchase product:
View purchase: