Free Code download of Inventory Management System Project in Python
Code of Inventory Management System is a Python code that can store and purchase thing. The sole purpose of the system is to insert, delete view, update, search  and organize the list of all things and enable we to purchase the ordered thing.
The Inventory Management System is a console application Project where we can access by entering specific alphabet keys. The Inventory Management System project in python can make the management and client transactions more useful.
The Inventory Management System project having a text file to store the list of all things and automatically shows the list when the application is started. The Inventory Management System project in python also has add-to-cart functionality that helps tpo store temporary thing when someone order in the system
Functional requirements of Inventory Management System Project in Python
- Inserting thing in Menu
- This is where the registered user to insert, delete view, update, search  and organize the information of thing. The registered user can insert a new thing by entering the Thing Number, Description, and Price.
- Show List of all things from Menu
- From here the registered user can view all available things on the list.
- Inquire about things in Menu
- In this menu, the registered user check the full details of an individual thing.
- Delete thing from Menu
- From here the registered user can delete a specific thing by entering thing Number of that thing.
- Delete specifics of thing from Menu
- This is where the registered user can update the details of specific things.
- Checkout Menu
- From here the registered user can checkout the registered user ordered thing from the shopping cart.
- Purchasing Menu
- From here the registered user can purchase thing and insert them to a shopping cart.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
unit_price={} description={} stock={} try: details = open("stock.txt","r") no_items = int((details.readline()).rstrip("\n")) for i in range(0,no_items): line = (details.readline()).rstrip("\n") x1,x2 = line.split("#") x1=int(x1) x2=float(x2) unit_price.update({x1: x2}) for i in range(0,no_items): line = (details.readline()).rstrip("\n") x1,x2 = line.split("#") x1=int(x1) description.update({x1: x2}) for i in range(0,no_items): line = (details.readline()).rstrip("\n") x1,x2 = line.split("#") x1=int(x1) x2=int(x2) stock.update({x1: x2}) except: print("Stock empty") finally: details.close() cart=[] c="y" print("Welcome to Inventory Management System") print() print("A-Add an item") print("R-Remove an item") print("E-Edit specifics of an item") print("L-List all items") print("I-Inquire about a item") print("P-Purchase") print("C-Checkout") print("S-Show all items purchased") print("Q-Quit") print("remove-Remove an item from the cart") print("help-See all commands again") print() total_cost=0 flag=0 while(c!= "q" or c!= "Q"): c= input("What would you like to do? ") if(c=="q" or c=="Q"): break elif(c=="A" or c=="a"): p_no = int(input("Enter item number: ")) p_pr = float(input("Enter item price: ")) p_desc = input("Enter item description: ") p_stock = int(input("Enter item stock: ")) m=0 for i in range(0,len(unit_price)): if(p_no in unit_price): p_no+=1 m=1 if(m==1): print() print("That item number already exists :(, changing value to ",p_no) unit_price.update({p_no: p_pr}) description.update({p_no: p_desc}) if(p_stock > -1): stock.update({p_no: p_stock}) else: p_stock = 0 stock.update({p_no: p_stock}) print("The stock of an item cannot be negative, the stock has been set to 0.") print() print("Item number: ",p_no," Description: ",description.get(p_no)," Price: ",unit_price.get(p_no)," Stock: ",stock.get(p_no)) print("Item was added successfully!") print() elif(c=="E" or c=="e"): print() p_no = int(input("Enter item number: ")) if(p_no in unit_price): p_pr = float(input("Enter item price: ")) p_desc = input("Enter item description: ") p_stock = int(input("Enter item stock: ")) unit_price.update({p_no: p_pr}) description.update({p_no: p_desc}) stock.update({p_no: p_stock}) else: print("That item does not exist, to add an item use a") print() elif(c=="R" or c=="r"): print() p_no = int(input("Enter item number: ")) if(p_no in unit_price): are_you_sure = input("Are you sure you want to remove that item(y/n)? ") if(are_you_sure=="y" or are_you_sure=="Y"): unit_price.pop(p_no) description.pop(p_no) stock.pop(p_no) print("Item successfully removed!") print() else: print("Sorry, we don't have such an item!") print() elif(c=="L" or c=="l"): print() print("Item and their prices: ",unit_price) print("Descriptions: ",description) print("Stock left of Item: ",stock) print() elif(c=="I" or c=="i"): print() p_no=int(input("Enter Item Number: ")) if(p_no in unit_price): print() print("Item number: ",p_no," Description: ",description.get(p_no)," Price: ",unit_price.get(p_no)," Stock: ",stock.get(p_no)) if(stock.get(p_no)<3 and stock.get(p_no)!=0): print("Only ",stock.get(p_no)," remaining! Hurry!") print() else: print("Sorry we don't have such an item!") print() elif(c=="P" or c=="p"): print() p_no = int(input("Enter Item number: ")) if(p_no in unit_price): if(flag==1): flag=0 stock_current = stock.get(p_no) if(stock_current>0): stock_current = stock.get(p_no) stock[p_no] = stock_current-1 item_price = unit_price.get(p_no) total_cost = total_cost+item_price print(description.get(p_no),"added to cart: ","$",item_price) cart.append(p_no) else: print("Sorry! We don't have that item in stock!") else: print("Sorry! We don't have such an item!") print() elif(c=="C" or c=="c"): print() print("You bought the following items: ",cart) print("Total: ","$",round(total_cost,2)) tax= round(0.12*total_cost,2) print("Tax is 12%: ","$",tax) total = round(total_cost+tax,2) print("After Tax: ","$",total) total_cost=0 flag=1 print() print("You can still purchase items after check out, your cart has been reset. To quit press q") print() elif(c=="help"): print() print("Help Centre") print("A-Add an item") print("R-Remove an item") print("E-Edit specifics of an item") print("L-List all items") print("I-Inquire about a item") print("P-Purchase") print("C-Checkout") print("S-Show all items purchased") print("remove-Remove an item from the cart") print("help-See all commands again") print("If you have any other questions or concerns please contact the manager.") print() elif(c=="remove" or c=="Remove"):#To remove an item from the cart print() are_you_sure = input("Are you sure you want to remove an item from the cart(y/n)? ") if(are_you_sure=="y"): p_no = int(input("Enter item number to remove from cart: ")) if(p_no in cart): stock_current = stock.get(p_no) stock[p_no] = stock_current+1 item_price = unit_price.get(p_no) total_cost = total_cost-item_price j=0 for i in range(0,len(cart)): if(i==p_no): j=i cart.pop(j) print(description.get(p_no),"removed from cart: ") print() else: print() print("That item is not in your cart!") print() elif(c=="s" or c=="S"): print() print(cart) print() else: print() print("ERROR! Contact manager for help!") print() if(total_cost>0 and flag==0): print() print("You bought: ",cart) print("Total: ","$",round(total_cost,2)) tax= round(0.12*total_cost,2) print("Tax is 12%: ","$",tax) total = round(total_cost+tax,2) print("After Tax: ","$",total) print("Thank you for using Inventory Management System") try: details = open("stock.txt","w") no_items=len(unit_price) details.write(str(no_items)+"\n") for i in range(0,no_items): details.write(str(i+1)+"#"+str(unit_price[i+1])+"\n") for i in range(0,no_items): details.write(str(i+1)+"#"+description[i+1]+"\n") for i in range(0,no_items): details.write(str(i+1)+"#"+str(stock[i+1])+"\n") except: print("Stock saved") finally: details.close() |