Prerequisites
Before running the system, ensure you have:- Python 3 installed
- All dependencies installed:
pip install -r requirements.txt - Input inventory file at
data/inventario.xlsx - (Optional) Email credentials configured in
.envfile
Execution Command
From the project root directory, run:Process Workflow
The system executes the following steps automatically (fromsrc/main.py:14-40):
Generate Excel Report
Creates multi-sheet Excel report with complete inventory, critical products, and at-risk productsConsole Output:
Generate Charts
Creates visualization charts for inventory status and ABC classificationConsole Output:
Complete Console Output Example
A successful execution displays:The checkmark (✅) emoji indicates successful completion of each step. The warning (⚠️) emoji indicates a non-critical issue (like email being skipped).
Understanding Console Messages
Success Indicators
| Message | Meaning | Source |
|---|---|---|
✅ Inventario cargado correctamente | Inventory file loaded successfully | src/loader.py:10 |
✅ Clasificación ABC aplicada | ABC classification completed | src/analisis.py:30 |
✅ Riesgo evaluado y reposición recomendada | Risk analysis and recommendations generated | src/decisiones.py:29 |
✅ Reporte Excel generado en [path] | Excel report created at specified path | src/reportes.py:31 |
✅ Gráficos generados correctamente | Charts created successfully | src/reportes_graficos.py:32 |
✅ Reporte enviado por correo | Email sent successfully | src/emailer.py:34 |
Warning Indicators
| Message | Meaning | Action Required |
|---|---|---|
⚠️ Envío de correo omitido (credenciales no configuradas) | Email credentials missing or invalid | Configure .env file with email credentials |
Error Indicators
| Message | Meaning | Action Required |
|---|---|---|
❌ Error al cargar inventario: [error] | Failed to load input file | Check that data/inventario.xlsx exists and is readable |
Exit Codes
The system uses standard exit codes:- 0: Success - All operations completed successfully
- Non-zero: Error - An exception occurred during execution
Execution Time
Typical execution times vary based on inventory size:- Small inventory (< 100 products): 1-2 seconds
- Medium inventory (100-1000 products): 2-5 seconds
- Large inventory (> 1000 products): 5-10 seconds
Email sending may add 2-5 additional seconds depending on network speed and attachment size.
Process Flow Diagram
Troubleshooting Common Issues
FileNotFoundError: data/inventario.xlsx
FileNotFoundError: data/inventario.xlsx
Cause: Input file doesn’t exist at the expected location.Solution:
- Ensure
data/inventario.xlsxexists in the project - Check the file path is correct
- Verify you’re running from the project root directory
PermissionError: output/reporte_inventario.xlsx
PermissionError: output/reporte_inventario.xlsx
Cause: Output file is open in Excel or permissions issue.Solution:
- Close the Excel file if it’s open
- Check write permissions on the
output/directory - Try running with appropriate permissions
ModuleNotFoundError: No module named 'pandas'
ModuleNotFoundError: No module named 'pandas'
Cause: Required dependencies not installed.Solution:
Email not sending (no error message)
Email not sending (no error message)
Cause: Email credentials not properly configured.Solution:
- Verify
.envfile exists and contains valid credentials - Check that variables don’t contain placeholder values
- See the Email Setup Guide for detailed configuration
Automated Execution
You can automate the system execution using:Cron (Linux/Mac)
Edit crontab:Task Scheduler (Windows)
Create a scheduled task to run:Next Steps
Understanding Outputs
Learn how to interpret the generated reports and charts
Email Setup
Configure email delivery for automated reporting