This project implements a Replenishment Engine designed to optimize inventory levels across pharmacy branches. It automates the identification of stock requirements, manages stock allocation from a central warehouse, facilitates external procurement (Local Purchase Orders - LPOs), and identifies excess inventory.
- Identifies Branch Replenishment Needs: Determines which products at each branch require additional stock based on minimum inventory levels and dynamically calculated
Min_StockandMax_Stock(based on 30-day sales and lead time). - Stock Allocation & LPO Generation: Allocates available stock from the central warehouse to fulfill branch requirements. For any unfulfilled demand, it generates Local Purchase Orders (LPOs) for external procurement.
- Excess Stock Identification: Identifies and flags products at branches that hold inventory exceeding optimal levels, using a "Days of Stock" (DOS) metric.
- Python: The core programming language used for the engine logic.
- Streamlit: Used for building the interactive web application interface.
- Pandas: Utilized for efficient data manipulation and analysis of CSV files.
The engine processes inventory data through a systematic flow:
- Identify Branch Replenishment Needs: Calculates
ReorderQtyfor each product at each branch ifBranch_Stockis belowMin_Stock.Min_StockandMax_Stockare dynamically calculated based onSales_30DandLead_Time_Days. - Check Warehouse for Stock Availability: Attempts to fulfill
ReorderQtyfromWarehouse_Stock. If warehouse stock is insufficient, a partial allocation is made, and the remaining quantity is flagged for an LPO. - Create Transfer Orders: Generates a detailed list of products to be moved from the central warehouse to specific branches.
- Prepare and Flag LPO Needs: Consolidates and lists all products requiring external procurement due to insufficient warehouse stock.
- Identify Excess Stock: Calculates excess stock using a "Days of Stock" (DOS) metric, based on
Branch_StockandSales_30D.
The application requires the following CSV files to be uploaded:
Branch_Inventory.csv: Contains current stock levels for products at each branch.Warehouse_Stock.csv: Contains current stock levels in the central warehouse.SKU_Master.csv: Contains master data for SKUs, includingMin_Stock,Max_Stock,Sales_30D,Lead_Time_Days, andVendorinformation.
Upon completion of each replenishment engine run, the following CSV files are generated in the outputs/ directory:
Transfer_Orders.csv: Details all products and quantities to be transferred from the central warehouse to specific branches. IncludesMin_Stock,Max_Stock,Branch_Stock, andWarehouse_Stockfor easier review.LPO_Needs.csv: Lists all products, required quantities, and associated vendors for external procurement.Excess_Stock.csv: Identifies products at branches that are overstocked, including the calculated excess quantity based on Days of Stock.
Watch a quick demonstration of the Replenishment Engine in action:
This application is built using Streamlit.
- Ensure Python Environment: Make sure you have Python 3.8+ installed. It's recommended to use a virtual environment.
- Install Dependencies:
(Assuming
pip install -r requirements.txt
requirements.txtexists and containsstreamlit,pandas, etc.) - Run the Streamlit App:
This will open the application in your web browser.
streamlit run streamlit_app.py