This Python application is a Store Inventory Management System that allows you to view, add, and backup product data in a database. It reads product information from a CSV file and stores it in an SQLite database. You can perform various operations on the products using a command-line menu interface.
- Python 3.x
models.py
(containing SQLAlchemy models) should be present in the same directory as this script.- A CSV file named
inventory.csv
with the product data.
-
Clone the repository to your local machine:
git clone https://github.com/ericsryan/python_techdegree_project_4.git
-
Navigate to the project directory:
cd python_techdegree_project_4
-
Install the required packages:
pip install -r requirements.txt
NOTE: It is recommended that you use a virtual environment to install the packages.
To run the Store Inventory Management System, follow these steps:
-
Open a terminal and navigate to the project directory.
-
Run the following command to start the application:
python app.py
-
You will see the main menu with the following options:
- [V]iew a product
- [A]dd a product to the database
- [B]ackup the database
- [E]xit the program
To add a new product to the database:
-
Select the "A" option from the main menu.
-
Enter the product name, price (e.g., $25.99), and quantity.
-
Confirm the information and choose whether to start over or return to the menu.
To view product details:
-
Select the "V" option from the main menu.
-
You will see a list of product IDs and names. Enter the ID of the product you want to view.
-
Product details, including price, quantity, and update date, will be displayed.
To create a backup of the database in a CSV file:
-
Select the "B" option from the main menu.
-
The database information will be exported to a file named
backup.csv
in the project directory.