Skip to content

Command-line tool that a supermarket can use to keep track of its inventory.

Notifications You must be signed in to change notification settings

gizembrasser/superpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Superpy: Supermarket inventory management

Superpy is a command-line interface (CLI) built for supermarkets to help manage their purchases, sales and inventory. It provides features to buy and sell products, check the inventory for expired products, produce reports on costs, revenue and profit for certain periods and more. It uses an internal date system that can be manually adjusted by the user.

Features

  • Date management: set and advance the internal date to simulate daily operations.
  • Inventory control: add/remove products from the inventory by buying and selling.
  • Reports: uses the rich module to generate reports within the CLI that show purchased/sold items, inventory and expired products.
  • Calculations: the system is able to calculate the costs, revenue and profit for specified time periods.
  • Data storage: all transactions are stored in CSV format for easy reference.

Installation

  • Make sure you have Python 3 installed.
  • Clone or download this repository to your local machine.
  • Navigate to the directory in the CLI and open the terminal.
  • The first command you run will generate all necessary CSV files.

Commands

  1. Set current date: $ python super.py set_today YYYY-MM-DD

Use the --today argument to set the current date to today.

  1. Get current date: $ python super.py get_today

Fetches the current date set by the user.

  1. Advance date: $ python super.py advance_time days

The days argument can also be a negative number to go back in time.

  1. Buy product: $ python super.py buy --product_name "name" --buy_price price --count 100 --expiration_date YYYY-MM-DD

The system will purchase a product and add it to the inventory. The --count option will default to 1 if you omit the argument.

  1. Sell product: $ python super.py sell --product_name "name" --sell_price price --count 100

The system will search for the product in the inventory, and sell if it's in stock. The --count option will default to 1 if you omit the argument.

  1. Generate report: $ python super.py report "file_name"

Will show a table in the CLI of a CSV file. Choose between: "bought", "sold", "inventory", "expired".

  1. Calculate costs: $ python super.py costs YYYY-MM-DD

Will display the costs for a specified time period. Can be used with the optional --today or --yesterday arguments.

  1. Calculate revenue: $ python super.py revenue YYYY-MM-DD

Will display the revenue for a specified time period. Can be used with the optional --today or --yesterday arguments.

  1. Calculate profit: $ python super.py profit YYYY-MM-DD

Will display the profit for a specified time period. Can be used with the optional --today or --yesterday arguments.

  1. Clear all CSV files: $ python super.py clear_history

Deletes all CSV files. Run any command to generate new ones.

Data storage

All transaction data is stored in CSV files located in the data directory.

  • bought.csv: contains details about bought products including id, name, buy date, buy price, count and expiration date.
  • sold.csv: contains details about sold products including id, name, buy date, buy price, count, sell date and sell price.
  • inventory.csv: contains details about the non-expired products.
  • expired.csv: contains details about the expired products.

The program reads the details from these files to calculate costs, revenue and profit.

Author

Gizem Brasser

About

Command-line tool that a supermarket can use to keep track of its inventory.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages