# oigonzalezp2024/python-software-architecture architecture

> Architecture diagram of the GitHub repository oigonzalezp2024/python-software-architecture, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oigonzalezp2024/python-software-architecture
- Repository: https://github.com/oigonzalezp2024/python-software-architecture

## Overview

##### Main Components
- Enterprise Layer:
- Enterprise/enterpriceDependecies: Ensures that all external dependencies are present.
- Enterprise/enterpriseCore: Consolidates dependencies through inheritance in a single core class.
- Enterprise/enterpriseDeployment: Manages cloning and updating dependencies from remote repositories.
- Enterprise/enterpriseFlaskFlow: Likely integrates with Flask for web-based flows if needed.
- Project Layer:
- Project/projectConfig: Contains the configuration (projectConfig.py) that determines how external dependencies are cloned and installed.
- Project/dependencies: Houses the actual external dependencies (external repositories cloned by the system).
- Project/data: Manages data access and transformation, along with organized directories for raw data (data, json, oneMonth, quarter, semester) and transformed results (transformedData -> adminPath, images, json).
- Project/extract: Implements data extraction processes (various Python scripts to pull data like “promediosSipsa…”).
- Project/reports: Houses generated PDF reports.
- Additional supportive directories such as static and templates (both at root and inside project) which provide styling and HTML for visualization via Flask.

##### Relationships and Interactions
- Dependency Management Flow:
- The process begins with the project configuration script (project/projectConfig/projectConfig.py) which, before any primary execution, verifies if external dependencies exist.
- If dependencies are missing, the system uses GitPython (and optionally gitPullDependencies.py) to clone/update the repositories stored under the enterprise layer.
- Data Flow and Processing:
- External data is first fetched using a SOAP webservice (via demoClienteWebserviceSipsa.py using the zeep library).
- The raw data is then delimited over time intervals (via demoDelimitedData.py) and further processed – extracted (project/extract scripts) and then transformed (demoTransformData.py writing to project/data/transformedData/json).
- Visualization of data occurs with demoMatplotDraw.py (drawing charts from the transformed data and saving images).
- Execution Cycle:
- A demonstration script (demoAll.py) ties all these functions together in a sequential execution, ensuring all parts of the system execute in a proper order.

##### Architectural Patterns and Technologies
- The architecture leverages modular separation between dependency management (enterprise) and business logic/data processing (project).
- The design hints at a layered or “pipeline” approach where data moves from extraction to transformation to reporting.
- The project uses external libraries (e.g., fpdf2 for PDF generation, GitPython for repository management, zeep for SOAP requests) that are central to certain layers of the architecture.
- The use of Flask (via enterpriseFlaskFlow and the presence of templates and static files) indicates there is also a web interface component, likely aimed at visualization or admin control.

##### Details to Capture
- Details such as:
- Dependency management using GitPython (and supporting libraries from enterprise modules),
- Data extraction, transformation, and visualization pipeline,
- Integration points (i.e., how the Flask-based interface retrieves and displays data processed by the system).

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Enterprise Layer"
        ED["Enterprise Dependencies (Enterprise Dependency Manager)"]:::enterprise
        EC["Enterprise Core (Enterprise Core)"]:::enterprise
        EDpl["Enterprise Deployment (Enterprise Deployment)"]:::enterprise
        EFF["Enterprise Flask Flow (Enterprise Flask Flow)"]:::enterprise
    end

    subgraph "Project Layer"
        PC["Project Configuration (project/projectConfig/projectConfig.py)"]:::project
        PD["Project Dependencies (project/dependencies)"]:::project
        DE["Data Extraction (project/extract)"]:::project
        DT["Data Transformation (demoTransformData.py)"]:::project
        VR["Visualization & Reporting (project/reports)"]:::project
        DS["Project Data Storage (project/data)"]:::project
        PS["Project Static Files (project/static)"]:::project
        PT["Project Templates (project/templates)"]:::project
    end

    Orch["Execution Orchestration (demoAll.py)"]:::orchestrator

    Orch --> PC
    PC --> ED
    PC --> PD
    PC --> DE
    EDpl --> EFF
    DE --> DT
    DT --> VR
    DT --> DS
    EFF --> PS
    EFF --> PT

    %% Click Events
    click Orch "https://github.com/oigonzalezp2024/python-software-architecture/blob/main/demoAll.py"
    click PC "https://github.com/oigonzalezp2024/python-software-architecture/blob/main/project/projectConfig/projectConfig.py"
    click PD "https://github.com/oigonzalezp2024/python-software-architecture/tree/main/project/dependencies"
    click ED "https://github.com/oigonzalezp2024/python-software-architecture/blob/main/enterprise/enterpriceDependecies/enterpriceDependecies.py"
    click EC "https://github.com/oigonzalezp2024/python-software-architecture/blob/main/enterprise/enterpriseCore/enterpriseCore.py"
    click EDpl "https://github.com/oigonzalezp2024/python-software-architecture/blob/main/enterprise/enterpriseDeployment/enterpriseDeployment.py"
    click EFF "https://github.com/oigonzalezp2024/python-software-architecture/blob/main/enterprise/enterpriseFlaskFlow/EnterpriseFlaskFlow.py"
    click DE "https://github.com/oigonzalezp2024/python-software-architecture/tree/main/project/extract"
    click VR "https://github.com/oigonzalezp2024/python-software-architecture/tree/main/project/reports"
    click DS "https://github.com/oigonzalezp2024/python-software-architecture/tree/main/project/data"
    click PS "https://github.com/oigonzalezp2024/python-software-architecture/tree/main/project/static"
    click PT "https://github.com/oigonzalezp2024/python-software-architecture/tree/main/project/templates"

    %% Styles
    classDef orchestrator fill:#FF9999,stroke:#333,stroke-width:2px;
    classDef enterprise fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef project fill:#99CCFF,stroke:#333,stroke-width:2px;
```
