Skip to content

This Python script helps manage stock inventory for a woodworking company. It supports adding, removing, displaying and saving locally a report on stocks available in a warehouse.

Notifications You must be signed in to change notification settings

HZloto/warehouse-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

warehouse-management

This Python script helps manage stock inventory for a woodworking company. It supports adding, removing, displaying and saving a report on stocks available in a warehouse. The user has the possibility to request the state of the whole inventory or a stock in particular.

How to use

  • Make sure that Stock.py, Warehouse.py and main.py are in the same folder in you local OS.
  • Open your terminal to the location of the folder and type “python main.py”
  • A menu will appear. Use the keypad to navigate (e.g. to add stock, input “1” in the Input Request box.
  • When done, hit “5” on the main menu to exit the script. (NOTE: All inventory will be reset to 0 after exiting the app).

    Design and architecture

    This app is developed with using Python with an “Object Oriented Programming” focus. It is split between three scripts described more in depth below. In short, all the constraints and information storing is in the Stock.py script, and all the display and app components are in Warehouse.py.

    Stock.py

    This script stores a class called “Generic Stock”, which defines a generic stock type and methods to add and remove stock. All stock have the “quantity” attribute, which is used as the memory endpoint to store the inventory every time an operation is done, to avoid using a .csv file.

    We use class inheritance to define three types of stock: Redwood, Maple and Oak. The super function allows to keep the methods of the Generic Stock function.

    Each inherited class has a particular attribute that is unique to each type of stock: Redwood has density, Maple has humidity, and Oak has varnish.

    We use a separate script for stock to keep all the definitions of functions and attribute in a tidy space without all the visual components of the app.

    Warehouse.py

    The Warehouse script contains the MainWarehouse class which includes all the functionalities of the app and its visual aspects.

    It has:

  • An init function: we use it to create objects for our stock and define a unit price, init quantity
  • add_stock: provides an interface to pick stock type to add, and what quanitity.
  • remove_stock: provides an interface to pick stock type to remove, and what quanitity
  • get_stock: Lets the user get a report on an individual stock
  • display_inventory: gives the user a full report of the inventory with the option to save the report as a .txt file
  • exit_program: Calls python’s exit function
  • input_check: Verifies that all menu inputs are integers
  • display_menu: Prints the different choices presented to the user and execute the function of the chosen path.

    Note: to avoid unwanted app termination, all the input checks are made using try/except or if statement. Assert statements can be found in the test script (see below.)

    Main.py

    Imports the elements of the MainWarehouse class from the Warehouse script. Triggers the display_menu() function as an entry point to access the app.

    Testing

    A test.py script is provided in the GitHub files. It features an edited version of the app to test its functionalities. All the user inputs are replaced by hard-coded answers to run through all the code. The test_warehouse() function runs through all functions separately and prints a success statement if all assets are checked.

  • About

    This Python script helps manage stock inventory for a woodworking company. It supports adding, removing, displaying and saving locally a report on stocks available in a warehouse.

    Topics

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages