0% found this document useful (0 votes)
19 views25 pages

CS Project

Uploaded by

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

CS Project

Uploaded by

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

Pt.

RAM CHANDRA MISHRA MEMORIAL PUBLIC SCHOOL


AFFILIATED TO CBSE NEW DELHI
Cover. Page:- AFFILIATION NO.2131699
SESSION-2024-25
SESSION-2024-25

School Photo

Subject:-
Inventory Management System
TOPIC :....................................................................

: Amol
Name Of The Students: Sharan
....................................................

Class :XII

Subject : Computer Science

Roll No. : .....................................

Sign. Of External Examiner Sign. Of Internal Examiner

Submitted to :-. Submitted By :

____________ ..............
CERTIFICATE

This is to certify that Amol Sharan


.............. student
Student of class 12th of
name............................................of
Pt. RAM CHANDRA MISHRA MEMORIAL PUBLIC SCHOOL
has completed the project "Inventory Management System" during the
academic session 2024-25 towards partial fulfillment of credit for the

AISSCE 2024-25 evaluation of CBSE 2024-25 and submitted satisfactory

report as compiled in the following pages under my supervision.

Mr. Amit Mishra

Deptt. Of Computer Principal


ACKNOWLEDGEMENT

I would like to express my special thanks of gratitude to my Principal Mr.

Amit Mishra Sir as well as our Computer teacher Mrs. Neeru Srivastava

who gave me the golden opportunity to do this wonderful project and

helped me in doing a lot of research and I came to know about so many


new things, I am really thankful to them.

Secondly, I would also like to thanks my parents and friends who helped me

a lot in finalizing this project within the given time frame.

Name of Student
DECLARATION

I , hereby declare that the project submitted to Pt. RAM CHANDRA

MISHRA MEMORIAL PUBLIC SCHOOL , PRAYAGRAJ for subject

Computer under the Guidance of Mrs. Neeru Srivastava Ma’am is

a record of original work done by me in the session of 2024-25 .

Name Of Student

.................................
Index
1. Introduction
2. Hardware and Software Requirements
o 2.1 Hardware Requirements
o 2.2 Software Requirements
3. Objective
4. Module Description
o 4.1 User Interface Module
o 4.2 Database Management Module
o 4.3 Inventory Operations Module
5. Database Table Description
6. Coding
o 6.1 Database Connection
o 6.2 Add Item Function
o 6.3 View Inventory Function
o 6.4 Update Item Function
o 6.5 Delete Item Function
o 6.6 Main Menu and User Interface
7. Output
o 7.1 Add Item Output
o 7.2 View Inventory Output
o 7.3 Update Item Output
o 7.4 Delete Item Output
8. Bibliography

9. Conclusion
Introduction

An inventory management system is a software application that allows businesses to track


inventory levels, orders, sales, and deliveries. This project aims to develop an inventory
management system using Python and MySQL. This system can help small to medium-sized
businesses streamline their inventory processes, reduce errors, and improve accuracy and
efficiency in managing stock.
Hardware and Software Requirements

Hardware Requirements:

 Processor: Intel Core i3 or higher


 RAM: Minimum 4GB
 Hard Disk: 1GB free space (for MySQL and Python installations)
 Display: Standard monitor, 1024x768 resolution or higher

Software Requirements:

 Operating System: Windows, macOS, or Linux


 Python: Version 3.6 or higher
 MySQL Database Server: MySQL version 5.7 or higher
 Python MySQL Connector: mysql-connector-python library
 IDE/Text Editor: PyCharm, VS Code, or any preferred Python IDE
Objective

The primary objectives of this inventory management system are:

 To enable the easy addition, updating, and deletion of inventory items.


 To track inventory quantities and categories efficiently.
 To facilitate the management of product data and provide timely information on stock
levels.
 To improve accuracy in inventory records and reduce instances of stock-outs or
overstocking.
Module Description

1. User Interface Module:

 A command-line interface to interact with the system.


 Provides options for adding, viewing, updating, and deleting items.

2. Database Management Module:

 Connects to MySQL to store, retrieve, update, and delete data from the inventory
table.
 Manages the inventory database schema and enforces constraints.

3. Inventory Operations Module:

 Manages core CRUD operations:


o Create: Adds new inventory items.
o Read: Retrieves all or specific items from the inventory.
o Update: Modifies existing items.
o Delete: Removes items from the database
Database Table Description

Table Name: inventory

Field Name Data Type Description


item_id INT (Primary Key, AUTOINCREMENT) Unique identifier for each item
item_name VARCHAR(50) Name of the item
category VARCHAR(30) Category of the item
quantity INT Quantity in stock
price DECIMAL(10, 2) Price per unit of the item

 item_id (Primary Key, INT, AUTO_INCREMENT):

 Purpose: Serves as the unique identifier for each inventory item.


 Description: This field is set to automatically increment with each new item added,
ensuring that no two items share the same ID.
 Constraints: Primary Key constraint ensures no duplicates in item_id, which
enforces uniqueness for each entry.

 item_name (VARCHAR(50)):

 Purpose: Stores the name of each item, making it easily identifiable.


 Description: The item_name field is a string with a character limit of 50, sufficient
for most product names.
 Constraints: You could add a NOT NULL constraint if you want to ensure each item
has a name.

 category (VARCHAR(30)):

 Purpose: Categorizes items for easier classification and retrieval.


 Description: This field helps group items into various types (e.g., "Electronics,"
"Stationery"), supporting faster search and filter operations based on categories.
 Constraints: You could consider setting a NOT NULL constraint if all items should
have a category.

 quantity (INT):

 Purpose: Tracks the current stock level of each item.


 Description: This field records the number of units available in inventory. This is
crucial for inventory management as it determines stock status.
 Constraints: Typically set as an integer without decimals, as quantities are usually
counted as whole numbers. You could enforce a default value (e.g., 0) or set
Example Data in the inventory Table

item_id item_name category quantity price


1 Laptop Electronics 15 1200.00
2 Chair Furniture 50 45.99
3 Notebook Stationery 200 2.50
4 Coffee Maker Appliances 10 85.00
5 Headphones Electronics 30 75.99

Constraints and Indexes

 Primary Key: The item_id field serves as the primary key, ensuring that each item
can be uniquely identified.
 Not Null Constraints: Typically, item_name, category, quantity, and price
would have NOT NULL constraints to ensure no essential information is left out.
 Indexing: The item_id is indexed by default as the primary key, enabling fast look-
up for CRUD operations. Additional indexes can be added on frequently queried
fields, such as category for faster category-based filtering.

Advantages of this Table Structure

 Flexibility: The structure allows easy addition of new items without altering the
schema.
 Scalability: The inventory table can hold a large number of items and allows for
quick retrieval, updates, and deletions.
 Data Integrity: Primary keys and data types (such as DECIMAL for prices) maintain
data consistency and reliability.
Coding

The coding section involves implementing the functionalities for managing inventory items.
Below is a summary of key functions and a sample code snippet.

Code Summary:

 Database Connection: Connects to MySQL.


 CRUD Functions: Handles item addition, retrieval, update, and deletion.
 Main Menu: Provides user options for interacting with the system.

MY SQL:
CREATE DATABASE inventory_db;

USE inventory_db;

CREATE TABLE inventory (

item_id INT PRIMARY KEY AUTO_INCREMENT,

item_name VARCHAR(50),

category VARCHAR(30),

quantity INT,

price DECIMAL(10, 2)

);
PYTHON:
import mysql.connector

# Establish MySQL connection

def connect_db():

try:

connection = mysql.connector.connect(

host="localhost",

user="your_username",

password="your_password",

database="inventory_db"

return connection

except mysql.connector.Error as err:

print(f"Error: {err}")

return None

# Add an item to the inventory

def add_item(name, category, quantity, price):

connection = connect_db()

if connection:

cursor = connection.cursor()

query = "INSERT INTO inventory (item_name, category, quantity, price) VALUES (%s, %s, %s,
%s)"

values = (name, category, quantity, price)

cursor.execute(query, values)

connection.commit()
print(f"Item {name} added successfully.")

cursor.close()

connection.close()

# View all items in the inventory

def view_inventory():

connection = connect_db()

if connection:

cursor = connection.cursor()

query = "SELECT * FROM inventory"

cursor.execute(query)

results = cursor.fetchall()

for row in results:

print(row)

cursor.close()

connection.close()

# Update an item’s details

def update_item(item_id, name=None, category=None, quantity=None, price=None):

connection = connect_db()

if connection:

cursor = connection.cursor()

updates = []

if name:

updates.append("item_name = %s")

if category:

updates.append("category = %s")
if quantity:

updates.append("quantity = %s")

if price:

updates.append("price = %s")

if updates:

query = f"UPDATE inventory SET {', '.join(updates)} WHERE item_id = %s"

values = tuple(val for val in [name, category, quantity, price] if val is not None) + (item_id,)

cursor.execute(query, values)

connection.commit()

print(f"Item ID {item_id} updated successfully.")

cursor.close()

connection.close()

# Delete an item from the inventory

def delete_item(item_id):

connection = connect_db()

if connection:

cursor = connection.cursor()

query = "DELETE FROM inventory WHERE item_id = %s"

cursor.execute(query, (item_id,))

connection.commit()

print(f"Item ID {item_id} deleted successfully.")

cursor.close()

connection.close()
# Main menu

if __name__ == "__main__":

while True:

print("\nInventory Management System")

print("1. Add Item")

print("2. View Inventory")

print("3. Update Item")

print("4. Delete Item")

print("5. Exit")

choice = input("Enter your choice: ")

if choice == "1":

name = input("Enter item name: ")

category = input("Enter category: ")

quantity = int(input("Enter quantity: "))

price = float(input("Enter price: "))

add_item(name, category, quantity, price)

elif choice == "2":

view_inventory()

elif choice == "3":

item_id = int(input("Enter item ID to update: "))

name = input("Enter new name (leave blank to skip): ")

category = input("Enter new category (leave blank to skip): ")

quantity = input("Enter new quantity (leave blank to skip): ")

price = input("Enter new price (leave blank to skip): ")

update_item(

item_id,
name if name else None,

category if category else None,

int(quantity) if quantity else None,

float(price) if price else None,

elif choice == "4":

item_id = int(input("Enter item ID to delete: "))

delete_item(item_id)

elif choice == "5":

break

else:

print("Invalid choice. Please try again.")

Explanation of the Output Messages

1. Add Item: Displays a message confirming that the item was added, showing the new
item ID.
2. View Inventory: Shows all items in the inventory, displaying columns for ID, name,
category, quantity, and price. If the inventory is empty, it indicates so.
3. Update Item: Confirms when an item is successfully updated or notifies if the item
ID does not exist.
4. Delete Item: Confirms if the item was successfully deleted or notifies if the item ID
does not exist.

These messages give users feedback on the status of their actions and make the system user-
friendly
Output

After implementing the above code and running the program, the following are some
expected outputs:

1. Add Item
User input: "Enter item name: Pen, Category: Stationery, Quantity: 100, Price: 1.00"
Output: "Item 'Pen' added successfully."
2. View Inventory
User input: Choosing "View Inventory" from the menu
Output: Display of all items in the inventory with their respective IDs, names,
categories, quantities, and prices.
3. Update Item
User input: Choosing an item by ID and updating quantity
Output: "Item ID 3 updated successfully."
4. Delete Item
User input: Choosing an item by ID to delete
Output: "Item ID 3 deleted successfully."

8. Bibliography

1. "Python Programming for the Absolute Beginner" by Michael Dawson – for Python
basics.
2. "MySQL for Database Management" by Paul DuBois – for insights into MySQL and
relational database management.
3. Online resources:
o Python Documentation: https://docs.python.org/3/
o MySQL Documentation: https://dev.mysql.com/doc/
4. Websites:
o Stack Overflow: For troubleshooting and debugging assistance
o MySQL and Python Connector documentation for MySQL integration:
https://pypi.org/project/mysql-connector-python/
Conclusion

1. Summary of the Project

The Inventory Management System developed in this project represents a significant


improvement in managing and tracking inventory for businesses. Utilizing Python for the
application logic and MySQL for database management, the system demonstrates a reliable,
efficient, and user-friendly approach to inventory control. This system allows businesses to
streamline their stock management, reducing manual errors and enhancing data accuracy
through a centralized database.

The inventory management system automates core inventory functions, including adding,
updating, viewing, and deleting items, as well as tracking stock levels. The system's design is
modular, providing separation between the user interface, database management, and CRUD
(Create, Read, Update, Delete) functions. This modular approach improves maintainability
and flexibility, ensuring the system can be expanded or modified with minimal disruption.

Through efficient data handling and structured coding, this system minimizes the challenges
businesses face in maintaining an accurate record of inventory. By connecting Python and
MySQL, the project successfully leverages the strengths of both technologies: Python’s
versatility in programming and MySQL’s robustness in handling relational data. The project
showcases a blend of technical skills and business process understanding, making it highly
applicable for real-world inventory applications.

2. Impact on Inventory Management

Inventory management is a core function in any organization that handles physical products.
The effectiveness of an inventory system directly impacts a company's operations, customer
satisfaction, and profitability. This system’s impact can be observed in the following ways:

 Accuracy and Reliability: The system reduces manual data entry errors and provides real-
time inventory data, which is crucial for making accurate business decisions. Having accurate
inventory records minimizes instances of overstocking and stockouts, leading to more
efficient stock management.
 Time and Cost Savings: Automating inventory tasks reduces the need for extensive manual
tracking, saving time and labor costs. Real-time access to inventory levels also helps avoid
unnecessary purchases, improving cost-efficiency.
 Improved Decision-Making: The system’s ability to track inventory movements and maintain
updated records provides business leaders with the insights needed to make informed
purchasing and sales decisions. For example, low stock alerts enable proactive restocking,
preventing disruptions in supply.
 Data Centralization: Storing all inventory data in a centralized database improves
accessibility and data integrity. Any authorized user can retrieve current stock information
from one source, ensuring that data discrepancies across departments are minimized.

In addition to these benefits, the system contributes to better customer satisfaction by


ensuring that items are readily available for sale, reducing delays in fulfilling customer
orders.
3. Challenges and Limitations

While the Inventory Management System provides significant benefits, some challenges and
limitations should be considered.

 Data Security: The system uses MySQL to store data, but without encryption or advanced
security features, the system might be vulnerable to unauthorized access if deployed in a
production environment. Implementing user authentication, encryption, and access control
can mitigate security risks.
 Scalability: While the current system is effective for small to medium-sized businesses,
scaling to a large organization with thousands of items may require database optimization
and improved indexing. Additional features like batch processing and bulk imports could
improve performance for larger datasets.
 Error Handling and Robustness: The command-line interface, while functional, has limited
error handling and user prompts. Users need to enter valid data types and adhere to
required input fields strictly. For a more robust solution, a graphical user interface (GUI) or
web-based front end would improve user experience by providing form validation and
reducing input errors.
 Limited Analytics: The system provides essential CRUD operations, but more complex
inventory management features, such as demand forecasting, product tracking by batches
or expiration dates, and supplier management, are not included. Integrating analytics could
help users predict future stock needs and manage supplier relationships better.

Addressing these limitations requires additional features, database optimization, and possibly
a different technology stack, which may increase the system’s complexity but would provide
a more comprehensive inventory management solution.

4. Future Scope and Improvements

Expanding the current system offers many possibilities for improvement and additional
functionalities. The following areas outline potential directions for future development:

 User Authentication and Role-Based Access Control: Introducing a login system with
different access levels (e.g., administrator, manager, and viewer roles) would increase data
security. Role-based access control ensures that only authorized personnel can make
changes to the inventory, while others may have read-only access.
 Graphical User Interface (GUI): Moving from a command-line interface to a GUI (or web-
based interface) would significantly improve user experience. A GUI would provide visual
feedback, form validation, dropdown menus, and alert notifications, making it easier for
users to navigate the system and reducing the learning curve for new users.
 Real-Time Inventory Tracking and Notifications: By integrating notifications or alerts, the
system could notify users when stock reaches predefined thresholds or when specific
products are out of stock. Real-time tracking would improve responsiveness to inventory
changes, allowing timely action.
 Advanced Reporting and Analytics: Adding reporting features that generate insights on
sales trends, stock movement, and demand forecasting could enable data-driven decision-
making. Analytical features could help businesses identify popular products, forecast
demand, and optimize stock levels.
 Integration with External Systems: Many businesses use a range of software tools for
different functions (e.g., accounting, e-commerce). Integrating the inventory management
system with accounting software or e-commerce platforms could streamline operations,
reduce redundancy, and maintain a seamless data flow across various functions.
 Support for Multiple Warehouses: Large businesses often manage stock across several
warehouses or locations. Implementing multi-location support would allow businesses to
manage and track inventory across different locations, optimizing inventory allocation and
reducing transit times.

These improvements would enhance the system's flexibility, performance, and usability,
allowing it to support a wider range of business types and sizes.

5. Reflections and Key Learnings

This project offered a valuable learning experience, from understanding the core concepts of
inventory management to implementing them through Python and MySQL. The process of
designing the database schema, implementing CRUD operations, and creating a user interface
underscored the importance of careful planning and modular design in software development.
Additionally, working with relational databases provided insights into structuring data
effectively, enforcing data integrity, and optimizing queries.

Developing this system also highlighted the importance of user-centered design. While a
command-line interface was practical for prototyping, user feedback could guide the
development of a more intuitive interface. This experience suggests that a balance of
technical efficiency and user experience is essential in creating effective software.

The project also emphasized the importance of adaptability in software solutions. As business
needs change, the system should be flexible enough to accommodate new requirements,
whether through modular code updates or database modifications.

6. Final Thoughts

In conclusion, this Inventory Management System project successfully meets the core
objectives of managing stock efficiently and accurately. By addressing the challenges and
exploring future improvements, the system has the potential to evolve into a comprehensive
tool for inventory management, supporting more advanced features and larger scales.

This project underscores the potential of technology in optimizing business processes,


enabling companies to operate more efficiently and respond better to market demands. In a
competitive business landscape, such systems offer a distinct advantage by providing reliable
data, reducing operational costs, and improving customer satisfaction. With continuous
refinement and expansion, this inventory management system can serve as a robust solution
adaptable to various business needs.

You might also like