← Back to all products
$49
Inventory Management System
Real-time inventory tracking with low-stock alerts, reorder automation, multi-warehouse support, and CSV/API sync.
MarkdownYAMLPythonSQL
📄 Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample📁 File Structure 22 files
inventory-management-system/
├── LICENSE
├── README.md
├── configs/
│ └── inventory_config.yaml
├── data/
│ ├── sample_products.csv
│ └── sample_stock.csv
├── free-sample.zip
├── guide/
│ ├── 01-overview.md
│ ├── 02-real-time-inventory-tracking.md
│ └── 03-reorder-automation-and-multi-warehouse-s.md
├── guides/
│ └── setup_guide.md
├── index.html
├── scripts/
│ └── run_inventory.py
├── sql/
│ └── schema.sql
├── src/
│ ├── __init__.py
│ ├── alerts.py
│ ├── csv_sync.py
│ ├── models.py
│ ├── reorder.py
│ ├── sync_adapter.py
│ ├── tracker.py
│ └── warehouse.py
└── tests/
└── test_inventory.py
📖 Documentation Preview README excerpt
Inventory Management System
Complete Python toolkit for real-time inventory tracking across multiple warehouses, with automated low-stock alerts, reorder point / EOQ calculations, and CSV/API synchronization.
What's Included
- Stock Tracker — Central coordinator that maintains stock levels and records every movement with a full audit trail
- Low-Stock Alerts — Configurable alert system with WARNING, CRITICAL, and STOCKOUT levels, cooldown periods, and pluggable handlers
- Reorder Engine — Automated reorder-point and Economic Order Quantity (EOQ) calculations with purchase order generation
- Multi-Warehouse Allocation — Three allocation strategies (priority, nearest, balanced) for deciding which warehouse fulfills each order
- CSV Import/Export — Bulk data operations with flexible column mapping (handles different CSV formats from various systems)
- Sync Adapter Interface — Abstract adapter pattern for connecting to external systems (Shopify, WooCommerce, ERPs, etc.)
- SQLite Schema — Ready-to-use database schema with indexed tables and reporting views
Quick Start
# Run the complete demo
python scripts/run_inventory.py
from src.tracker import InventoryTracker
from src.alerts import AlertManager, log_alert_handler
from src.models import Product
# Set up tracking with alerts
tracker = InventoryTracker(db_path="data/inventory.db")
alert_mgr = AlertManager()
alert_mgr.add_handler(log_alert_handler)
tracker.add_observer(alert_mgr.on_stock_change)
# Register products, record movements, check levels
tracker.register_product(Product(sku="SKU-001", name="Widget", unit_cost=10.0, unit_price=29.99))
tracker.record_purchase("SKU-001", "WH-EAST-01", 200, po_number="PO-1234")
tracker.record_sale("SKU-001", "WH-EAST-01", 5, order_id="ORD-5678")
level = tracker.get_stock_level("SKU-001", "WH-EAST-01")
print(f"Available: {level.quantity_available} | Status: {level.status.value}")
Contents
├── src/ — Core Python package (7 modules)
│ ├── models.py — Product, Warehouse, StockLevel, StockMovement, PurchaseOrder
│ ├── tracker.py — InventoryTracker with movement recording and observer pattern
│ ├── alerts.py — AlertManager with configurable thresholds and handlers
│ ├── reorder.py — ReorderEngine with ROP, EOQ, and PO generation
│ ├── warehouse.py — WarehouseManager with allocation strategies
│ ├── csv_sync.py — CSVImporter and CSVExporter with flexible column mapping
│ └── sync_adapter.py — SyncAdapter ABC, InMemoryAdapter, RESTAdapter template
├── sql/schema.sql — SQLite schema with indexes and reporting views
├── configs/ — Annotated YAML configuration
├── data/ — Sample CSVs (15 products, 19 stock level records)
├── scripts/ — Runnable demo script
├── tests/ — Unit tests (20+ test cases)
└── guides/ — Detailed setup and usage guide
... continues with setup instructions, usage examples, and more.
📄 Code Sample .py preview
src/alerts.py
"""
Low-Stock Alert Manager — Inventory Management System
======================================================
Monitors stock levels and dispatches configurable alerts when inventory
drops below defined thresholds.
Alert levels:
- WARNING: Stock approaching reorder point (configurable buffer %)
- CRITICAL: Stock at or below reorder point — needs immediate reorder
- STOCKOUT: Zero available stock — lost sales are happening NOW
The alert manager is designed as an observer that plugs into the
InventoryTracker. Every time a stock movement is recorded, the tracker
calls our on_stock_change method, and we evaluate whether an alert
should fire.
"""
from __future__ import annotations
import json
import logging
from dataclasses import dataclass, field
from datetime import datetime, timezone
from enum import Enum, IntEnum
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
from src.models import StockLevel, StockMovement, StockStatus
logger = logging.getLogger(__name__)
class AlertLevel(IntEnum):
"""Severity levels for inventory alerts.
IntEnum so we can compare: STOCKOUT > CRITICAL > WARNING > INFO.
Higher numeric value = more urgent.
"""
INFO = 0
WARNING = 1
CRITICAL = 2
STOCKOUT = 3
@dataclass
class Alert:
"""A single alert event with all context needed to act on it.
Alerts are immutable records. Once created, they're dispatched to
all registered handlers and then stored in the alert history.
# ... 310 more lines ...