A Python program that reads and prepares shoe data from 'inventory.txt' for presentation to managers, used to manage a Nike warehouse's stock taking. Uses the Shoes class with attributes country, code, product, cost, and quantity, and methods such as get_cost, get_quantity, and str. Defines functions outside the class to perform operations on the data.
The program is written in Python and is used to manage a Nike warehouse's stock taking. It allows the user to perform various operations on the data stored in a text file named "inventory.txt"
The program consists:
- Shoes: This class represents a shoe object and has the following attributes: country: The country where the shoe is manufactured code: The code assigned to the shoe product: The name of the product cost: The cost of the shoe quantity: The quantity of the shoes available This class also contains the following methods:
- get_cost: Returns the cost of the shoe
- get_quantity: Returns the quantity of the shoe
- str: Returns a string representation of the class
- A list named "shoes" to store the shoe objects.
- There are also several functions outside the class, which are:
- read_shoes_data: This function reads data from the "inventory.txt" file, creates a shoe object with this data and appends it to the "shoes" list.
- capture_shoes: This function allows the user to capture data about a shoe, creates a shoe object, and appends it to the "shoes" list.
- view_all: This function iterates over the "shoes" list and prints the details of each shoe object.
- re_stock: This function finds the shoe object with the lowest quantity, asks the user if they want to add to this quantity, and updates the file for this shoe.
- search_shoe: This function searches for a shoe in the list using its code and returns the object.
- value_per_item: This function calculates the total value of each item by multiplying the cost and quantity and prints this information on the console.
- highest_qty: This function determines the product with the highest quantity and prints it as being for sale.
Pre-requisites: This program does not require the installation of any Module libraries. Usage: To start the program, type the following command into the terminal:
python inventory.py
The program will display a menu with eight options:
This option will read the data from the file named 'inventory.txt' and stores it in memmory prompting the user:
No other option will work unless the file 'inventory.txt' is pre-loaded. If the file is not preloaded the following massage will be depicted, upon selection of any remaining option:
This option adds new data to the shoe list for the new shoes that are to be added to the inventory. It will prompt the user to enter, the coutry, the shoes code, the product name, the cost and the quatity to be added to the inventory
Once the above data is introduced a message is displayed to inform the user.
Note: if -1 is typed at any of the above prompts, the program will return to the Main Menu
This option is used to view all the shoes data stored in the shoe_list inventory.
This option will update the quantity of shoes selected by the user in the inventory. The programme will list the three shoe products with the lowest quantity and suggest which shoes should be restocked. Once the product has been identified, the programme will request that the amount be restocked and will notify the user accordingly.
Note: if -1 is typed at any of the above prompts, the program will return to the Main Menu
This option will allow the user to search for a shoe by entering a code in the form of "SKU00000".
Note: if -1 is typed at any of the above prompts, the program will return to the Main Menu
This option will calculate the total value of the shoes in stock by multiplying the cost of each item by its quantity and display it accordingly.
This option will output the highest quantity of shoes item for sale.
This option will terminate the program and advise the user.
Created by Fernando Vinagre