Quick Start Guide
This guide will walk you through your first inventory analysis in just a few minutes. By the end, you’ll have processed inventory data, generated reports, and understood the system’s outputs.Prerequisites
Before starting, make sure you’ve completed the installation steps and have Python 3 and all dependencies installed.Step-by-Step Tutorial
Create Sample Inventory Data
Create a file named
inventario.xlsx in the data/ directory with the following structure:| producto | stock_actual | stock_minimo | ventas_mensuales |
|---|---|---|---|
| Laptop HP | 15 | 10 | 45 |
| Mouse Logitech | 8 | 20 | 60 |
| Teclado Mecánico | 25 | 15 | 30 |
| Monitor Samsung | 5 | 12 | 40 |
| Cable HDMI | 50 | 30 | 25 |
| Auriculares Sony | 12 | 10 | 35 |
These four columns are required:
producto, stock_actual, stock_minimo, and ventas_mensuales. The system will fail if any column is missing.Review the Excel Report
Open
output/reporte_inventario.xlsx to see the generated report with three sheets:- Inventario_Completo: Full inventory with ABC classification and stock status
- Productos_Criticos: Products with CRÍTICO status (immediate attention needed)
- Productos_En_Riesgo: Products with RIESGO status (monitor closely)
View the Generated Charts
Check the
output/graficos/ directory for two PNG files:- estado_inventario.png: Bar chart showing distribution of OK/RIESGO/CRÍTICO products
- clasificacion_abc.png: Pie chart showing A/B/C category distribution
Understanding the Business Logic
The system applies two key analyses to your inventory:ABC Classification
Products are categorized by their contribution to total sales (fromanalisis.py:20-26):
- Category A: Top 70% of cumulative sales (high-value products)
- Category B: Next 20% (70-90% cumulative sales)
- Category C: Remaining 10% (low-value products)
- Laptop HP (45 sales), Mouse Logitech (60 sales), Monitor Samsung (40 sales) → Likely Category A
- Other products → Categories B or C
Stock Status Evaluation
Each product receives a status based on current stock vs. minimum threshold (fromdecisiones.py:11-17):
- OK:
stock_actual > stock_minimo × 1.2(healthy buffer) - RIESGO:
stock_minimo < stock_actual ≤ stock_minimo × 1.2(approaching minimum) - CRÍTICO:
stock_actual ≤ stock_minimo(below minimum, immediate action required)
Reorder Calculation
For products in CRÍTICO or RIESGO status, the system recommends (fromdecisiones.py:22-25):
Real-World Example
Using the sample data above:| Product | Status | Reason | Action |
|---|---|---|---|
| Mouse Logitech | CRÍTICO | 8 ≤ 20 (below minimum) | Reorder 52 units immediately |
| Monitor Samsung | CRÍTICO | 5 ≤ 12 (below minimum) | Reorder 35 units immediately |
| Teclado Mecánico | OK | 25 > 15 × 1.2 = 18 (healthy buffer) | No action needed |
| Auriculares Sony | RIESGO | 10 < 12 ≤ 12 × 1.2 = 14.4 (approaching minimum) | Monitor closely, may need 23 units |
Common Issues
FileNotFoundError: data/inventario.xlsx not found
FileNotFoundError: data/inventario.xlsx not found
Create the
data/ directory in your project root and place your inventory Excel file there. The system looks for data/inventario.xlsx by default (configured in main.py:9).KeyError: 'producto' or other column name
KeyError: 'producto' or other column name
Your Excel file must have these exact column names:
producto, stock_actual, stock_minimo, ventas_mensuales. Check for typos or missing columns.Email warning appears
Email warning appears
This is expected if you haven’t configured email credentials. See the email setup guide to enable automated email delivery.
No output files generated
No output files generated
Check the console for error messages. The system creates
output/ and output/graficos/ directories automatically, but it needs write permissions in your project folder.Next Steps
Configure Email
Set up automated email delivery for your reports
Customize Output
Adjust file paths and system settings
Understand ABC Classification
Learn the methodology behind product categorization
Extend the System
Add custom features and integrate with other tools