# albertnath/proyecto01_myp_2022_2 architecture

> Architecture diagram of the GitHub repository albertnath/proyecto01_myp_2022_2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/albertnath/proyecto01_myp_2022_2
- Repository: https://github.com/albertnath/proyecto01_myp_2022_2

## Overview

##### Project type and purpose
- This is a Python‐based standalone application (both CLI and GUI) whose job is to read a CSV file of airport coordinates, fetch weather data from the OpenWeatherMap API, and present it either on the console or through a simple Tkinter GUI.

##### File structure
- Top‐level: README.md, docs/, src/
- docs/: LaTeX sources and final PDF documentation
- src/
- csv/: holds dataset1.csv (input data store)
- gui/: contains the Tkinter interface (interfaz.py)
- main/: core modules
– constantes.py: holds the API key
– entrada.py: CSV parsing & argument handling
– aereopuerto.py: airport‐specific data structures
– reporteClima.py: wrapper around OpenWeatherMap REST API (uses requests)
– salida.py: output formatting for console
– main.py: orchestration entry point
- test/: unit tests for entrada and reporteClima

##### Extract architectural insights from the README
- Dependencies: python3, requests (HTTP), csv (built-in), tkinter (GUI)
- Execution flow described: set API key, run main/main.py, optional unit tests

a. Main Components
- Data Store: CSV file (dataset1.csv)
- Input Module: entrada.py (CSV reader & parameter extractor)
- Domain Model: aereopuerto.py (airport coordinate abstraction)
- Processing Module: reporteClima.py (external API client)
- Configuration: constantes.py (API key)
- Output Modules:
– salida.py (console output)
– gui/interfaz.py (Tkinter window)
- Orchestrator: main.py (ties everything together)
- External Service: OpenWeatherMap REST API
- Tests: test suite under src/test/

b. Relationships & Data Flows
1. User invokes main.py
2. main.py calls entrada.py → reads dataset1.csv → produces a list of airport coordinate objects
3. For each airport pair, main.py calls reporteClima.py → makes HTTPS requests to OpenWeatherMap → returns weather data
4. main.py hands results to salida.py and/or gui/interfaz.py for presentation
5. Results displayed in console or GUI window
6. Unit tests independently import entrada and reporteClima to validate parsing and API handling

c. Architectural Patterns & Principles
- Modular layering: separation of concerns (I/O, domain, service integration, presentation)
- Single‐process, synchronous orchestration
- Dependency inversion: main.py depends on abstracted modules, not on API details

d. Key Technologies
- Python 3.x
- csv module for parsing
- requests for HTTP calls
- tkinter for GUI
- unittest for tests

## Diagram (Mermaid)

```mermaid
graph TB
    %% Data Layer
    subgraph "Data Layer"
        direction TB
        CSV[(dataset1.csv)]:::data
    end

    %% Configuration Layer
    subgraph "Configuration"
        direction TB
        Constantes["constantes.py"]:::data
    end

    %% Core Logic Layer
    subgraph "Logic Layer"
        direction TB
        Entrada["entrada.py"]:::logic
        Aereopuerto["aereopuerto.py"]:::logic
        ReporteClima["reporteClima.py"]:::logic
        Main["main.py"]:::logic
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Salida["salida.py"]:::presentation
        Interfaz["interfaz.py"]:::presentation
    end

    %% External Service
    subgraph "External Service"
        direction TB
        OpenWeatherMap[(OpenWeatherMap API)]:::external
    end

    %% Test Suites
    subgraph "Tests"
        direction TB
        TestEntrada["testEntrada.py"]:::test
        TestReporteClima["testReporteClima.py"]:::test
    end

    %% Data Flow and Calls
    Main -->|"invoke"| Entrada
    Entrada -->|"read CSV → list of Airport objects"| CSV
    Entrada -->|"creates"| Aereopuerto
    Main -->|"for each Airport object → fetch weather"| ReporteClima
    ReporteClima -->|"uses API key"| Constantes
    ReporteClima -->|"HTTP GET → JSON response"| OpenWeatherMap
    Main -->|"hand off results"| Salida
    Main -->|"hand off results"| Interfaz

    %% Tests Dependencies
    TestEntrada -->|"tests parsing"| Entrada
    TestReporteClima -->|"tests API client"| ReporteClima

    %% Click Events
    click CSV "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/csv/dataset1.csv"
    click Entrada "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/main/entrada.py"
    click Aereopuerto "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/main/aereopuerto.py"
    click ReporteClima "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/main/reporteClima.py"
    click Constantes "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/main/constantes.py"
    click Salida "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/main/salida.py"
    click Interfaz "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/gui/interfaz.py"
    click Main "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/main/main.py"
    click TestEntrada "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/test/testEntrada.py"
    click TestReporteClima "https://github.com/albertnath/proyecto01_myp_2022_2/blob/main/src/test/testReporteClima.py"

    %% Styles
    classDef data fill:#c8e6c9,stroke:#2e7d32,color:#1b5e20
    classDef logic fill:#bbdefb,stroke:#1976d2,color:#0d47a1
    classDef presentation fill:#ffe0b2,stroke:#ef6c00,color:#e65100
    classDef external fill:#e0e0e0,stroke:#616161,color:#212121
    classDef test fill:#f3e5f5,stroke:#8e24aa,color:#4a148c
```
