Overview
The inventory management system uses environment variables for configuration, primarily for email delivery credentials. This guide covers all configuration options available in the system.Environment Variables Setup
The system uses thepython-dotenv library to load configuration from a .env file located in the project root directory.
Creating the .env File
Create the file
Create a new file named
.env in the root directory of the project (same level as src/ folder):Configuration Variables
Email Configuration
These variables are loaded insrc/config.py:6-8:
| Variable | Description | Required | Example |
|---|---|---|---|
EMAIL_REMITENTE | Sender email address (Gmail) | Yes* | [email protected] |
EMAIL_PASSWORD | Gmail app password | Yes* | abcd efgh ijkl mnop |
EMAIL_DESTINATARIO | Recipient email address | Yes* | [email protected] |
*Required only if you want to enable automatic email delivery. The system will work without these variables, but email sending will be skipped.
File Paths Configuration
These paths are defined insrc/main.py:9-11 and can be modified if needed:
| Variable | Default Value | Description |
|---|---|---|
RUTA_INVENTARIO | data/inventario.xlsx | Input inventory Excel file |
RUTA_REPORTE | output/reporte_inventario.xlsx | Output report Excel file |
CARPETA_GRAFICOS | output/graficos | Directory for generated charts |
How Configuration is Loaded
The configuration loading process (fromsrc/config.py:1-8):
Email Validation
The system validates email configuration before attempting to send emails (fromsrc/main.py:23-40):
- All three email variables are defined
- Variables are not set to placeholder/example values
- Configuration appears to be valid
If any validation check fails, the system continues running but skips email delivery and displays a warning message.
Modifying File Paths
To change the default input or output locations, edit the constants insrc/main.py:9-11:
SMTP Configuration
The system uses Gmail’s SMTP server with SSL encryption (configured insrc/emailer.py:30):
- Server:
smtp.gmail.com - Port:
465(SSL) - Authentication: Required
- Encryption: SSL/TLS
Configuration Checklist
Before running the system, verify:-
.envfile exists in project root - Email credentials are correctly configured
- Gmail app password is generated (not regular password)
- Input file exists at
data/inventario.xlsx - Application has write permissions for
output/directory - All required dependencies are installed (
pip install -r requirements.txt)
Next Steps
Email Setup
Configure Gmail app passwords and test email delivery
Running the System
Learn how to execute the system and understand the output