How albertnath/proyecto01_myp_2022_2 works
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