<jupyter_start><jupyter_text>Purchasing The Products<jupyter_code>print("*******************MENU*******************")
print("product_id    product_name",end="\n\n")
for i in products.keys():
    print(i,"        ",products[i]["Name"])<jupyter_output><jupyter_text>Getting Product Id and quantity<jupyter_code>user_id=input("Enter the product id :")
quantity=int(input("Enter The Quantity :"))
product_id=products.keys()

if (user_id not in product_id):
    print("Entered wrong Product Id ")
    
    
    
flag=0
if(products[user_id]["Quantity"]<quantity):
    print("The available quantity is :" ,products[user_id]["Quantity"])
    ans=int(input("Do you want to take these quantity(1-yes/0-No)"))
    if(ans):
        print("The bill is processed!!")
        quantity=products[user_id]["Quantity"]
        
    else:
        flag=1
        print("choose any other product")
  
products[user_id]["Quantity"]-=quantity<jupyter_output>Enter the product id :1020
Enter The Quantity :1<jupyter_text>Printing The Bill<jupyter_code>if(flag==0):
    print("*************Bill***********",end=" ")
    print("Time :",time.ctime(),"**********************")
    print("Product :",products[user_id]["Name"])
    print("Quanity :",quantity)
    print("Price :",products[user_id]["Price"])
    print("Billing Amount :",products[user_id]["Price"]*quantity)
    print("***********************************************************************************")<jupyter_output><jupyter_text>Making Transaction Details<jupyter_code>trans_id=len(sales)+1
trans_details=products[user_id].copy()
trans_details['time']=time.ctime()
trans_details['Quantity']=quantity
sales[trans_id]=trans_details<jupyter_output><empty_output><jupyter_text>Adding the products to the Inventory<jupyter_code>print("To Add Product")
product_id=products.keys()
new_id=input("Enter the id of the product")
if new_id in product_id:
    qun=int(input("Enter the product Quantity"))
    products[new_id]["Quantity"]+=qun
    print("Qunatity Added")
else:
    nname=input("Enter the name of the product")
    nprice=int(input("enter the price"))
    nquantity=int(input("enter the quantity"))
    nbrand=input("Enter the brand of the product")
    medate=input("Enter the expiry date of the product")
    new_product["Name"]=nname
    new_product["Price"]=nprice
    new_product["Quantity"]=nquantity
    new_product["ExpiryDate"]=medate
    new_product["Brand"]=nbrand
    products[new_id]=new_product


fd=open("records.json","w")
jformat=json.dumps(products)
fd.write(jformat)
fd.close()
fd=open("sales.json","w")
jformat=json.dumps(sales)
fd.write(jformat)
fd.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20838052095130238, 'fraction_numerical': 0.004152510381275953, 'mean_word_length': 6.42296918767507, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '53869', 'license': 'MIT', 'n_tokens_mistral': 898, 'n_tokens_neox': 862, 'n_words': 152, 'path': 'Amazing Python Projects_Scripts/Inventory Management System with JSON/ims.ipynb', 'repo_name': 'Manas1820/Hacktoberfest2021_awesome-projects', 'size': '2649'}