The Control Program project aims to analyze and process data related to sales campaigns, audience segmentation, and geographic-demographic analysis. This system supports campaign management, data analysis, and the generation of visual and interactive reports for strategic decision-making.
Designed to be modular and scalable, the project integrates tools for data analysis, processing through formats like PowerBI, Excel, Python, HTML/JSON, and an intuitive graphical user interface (GUI) for easy interaction.
1. main_gui.py
Main script to launch the graphical user interface. It enables users to interact with project functionalities such as campaign management, result visualization, and filtering options.
2. util/
Utility folder containing configuration files and constant definitions.
-
credentials.yaml: Stores external access credentials (e.g., database or API keys).
-
- Static resources like images and geographic JSON files.
- Icons:
icono_cogno.png,logo_cogno.png, etc. - Maps:
México.json,mexicoHigh.json
- Icons:
- Static resources like images and geographic JSON files.
3. functions/
Core logic and processing modules.
analisis_html.py: Parses and processes HTML data for extracting campaign or product insights.campana.py: Handles logic related to monetization campaigns.connection.py: Manages connections to databases and APIs.GUI.py: Implements the GUI structure and user interaction flows.monetizacion.py: Performs calculations and generates monetization analysis.path.py: Path management and file routing.productos.py: Handles product and category information processing.publicos_objetivo.py: Segments customers into strategic audiences.query_builder.py: Dynamically builds SQL queries based on filters.radiografia.py: Generates brand-level analytical summaries (for PowerBI reports).
4. pages/
Additional GUI pages, such as advanced reports or configuration panels.
5. sql_queries/
(SQL folder – coming soon): For modular SQL query files, reusable and cleaner.
6. test/
Testing and debugging notebooks/scripts.
test_analisis_bc.ipynb: Example notebook for testing Business Case logic.
Each section in the GUI corresponds to a specific stage of the analysis workflow:
📸 Main menu interface.
Users select the Products, Brands, Suppliers, and Categories to be analyzed.
📸 Product selection interface.
📸 Categories selection.
This module allows analysis of selected products by filters such as Socioeconomic Level, Store Type, and Product Families. Users can define date ranges and purchase conditions (e.g., minimum ticket).
📸 Business Case Analysis.
📸 Business Case - Report Example.
Classifies the customer base into Loyal, Acquired, or Recovered groups based on behavioral patterns. This section quantifies the potential audience for a campaign.
📸 POs menu.
Based on the audience segments, this section shows how many users can be contacted via SMS, Email, or WhatsApp. It helps generate prioritized communication lists per channel.
📸 Contactable audience by channel.
📸 Contactable audience by channel - Segment by Condition.
Users define an analysis period and ticket condition. This section performs a deep analysis of the selected brand, generating insights for PowerBI reports (auto-exportable).
📸 Long Radiography selection.
An example of the Long Radiography report can be accesed in the PDF folder
📸 Short Radiography selection.
An example of the Short Radiography report can be accesed in the PDF folder
Allows users to see, add, update or delete campaign results. All results are stored in the SQL Database and feed the PowerBI Reports.
📸 Campaign Results interface.
An example of the Campaign Results report can be accesed in the PDF folder
Allows users to revisit and download previously generated tables and datasets.
📸 Export generated datasets.
This project provides a comprehensive tool for managing and analyzing sales campaigns, customer behavior, product performance, and generating strategic audiences for communication.
- ✅ Process Automation – Eliminates repetitive manual tasks in report generation.
- ✅ Enhanced Decision-Making – Data visualizations provide clear campaign insights.
- ✅ Modular & Scalable Design – Easy to expand and integrate with new features or systems.
- ✅ Time Savings – Cuts analysis time by over 80%, allowing focus on higher-impact data science.
- ✅ Improved Information Control – Simple generation, viewing, and export of reports.
- ✅ Centralized Platform – Everything needed for campaign planning in one place.
For questions or suggestions, please contact:
Ricardo Jaramillo
📧 [email protected]
- ✅ Easy to adapt to other products or market segments.
- 🚀 Plans for future integration with Streamlit or cloud APIs.
- 🔐 Secure credentials stored separately.
- 🧠 Built with modular Python components for clarity and maintainability.
Install dependencies via:
pip install -r requirements.txt










