# soumadriano/trabalho-final-t5 architecture

> Architecture diagram of the GitHub repository soumadriano/trabalho-final-t5, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/soumadriano/trabalho-final-t5
- Repository: https://github.com/soumadriano/trabalho-final-t5

## Overview

This is a Python/PostgreSQL ETL pipeline for federal business-travel data. Its main workflow downloads and preserves four CSV datasets in Raw, converts and loads them into relational Silver tables, then uses a notebook to create Gold aggregates and answer business questions with charts. The graph includes the documented schema and analysis capabilities; notebook and SQL internals were not sampled, so those relationships are based on the README.

Main entry points: [`2_transformar.py`](https://github.com/soumadriano/trabalho-final-t5/blob/main/2_transformar.py) (Clean and type), [`1_extrair.py`](https://github.com/soumadriano/trabalho-final-t5/blob/main/1_extrair.py) (Download and load), [`0_criar_banco.sql`](https://github.com/soumadriano/trabalho-final-t5/blob/main/0_criar_banco.sql) (Silver tables), [`banco.py`](https://github.com/soumadriano/trabalho-final-t5/blob/main/banco.py) (PostgreSQL connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Extraction and Raw"]
  node_extract["Download and load<br/>[1_extrair.py]"]
  node_raw[("Raw tables<br/>[0_criar_banco.sql]")]
end

subgraph group_transform["Silver Transformation"]
  node_transform["Clean and type<br/>[2_transformar.py]"]
  node_silver[("Silver tables<br/>[0_criar_banco.sql]")]
end

subgraph group_analysis["Gold Analysis"]
  node_gold[("Gold tables and views<br/>[3_analise.ipynb]")]
  node_business["Business questions<br/>[3_analise.ipynb]"]
  node_charts["Charts and results<br/>[3_analise.ipynb]"]
end

subgraph group_shared["Shared Infrastructure"]
  node_schema["Database schema<br/>[0_criar_banco.sql]"]
  node_connection["PostgreSQL connection<br/>[banco.py]"]
  node_configuration["Runtime configuration<br/>[config.py]"]
end

node_portal(("Travel data source"))
node_drive(("Google Drive"))

node_portal -->|"publishes data"| node_drive
node_drive -->|"provides ZIP"| node_extract
node_extract -->|"loads CSVs"| node_raw
node_schema -->|"defines tables"| node_raw
node_schema -->|"defines tables"| node_silver
node_extract -->|"connects via"| node_connection
node_transform -->|"reads blocks"| node_raw
node_transform -->|"converts and loads"| node_silver
node_transform -->|"connects via"| node_connection
node_silver -->|"aggregates from"| node_gold
node_gold -->|"answers"| node_business
node_business -->|"visualizes results"| node_charts
node_connection -->|"reads credentials"| node_configuration
node_extract -->|"reads settings"| node_configuration
node_transform -->|"reads batch size"| node_configuration

click node_extract "https://github.com/soumadriano/trabalho-final-t5/blob/main/1_extrair.py"
click node_raw "https://github.com/soumadriano/trabalho-final-t5/blob/main/0_criar_banco.sql"
click node_schema "https://github.com/soumadriano/trabalho-final-t5/blob/main/0_criar_banco.sql"
click node_transform "https://github.com/soumadriano/trabalho-final-t5/blob/main/2_transformar.py"
click node_silver "https://github.com/soumadriano/trabalho-final-t5/blob/main/0_criar_banco.sql"
click node_gold "https://github.com/soumadriano/trabalho-final-t5/blob/main/3_analise.ipynb"
click node_business "https://github.com/soumadriano/trabalho-final-t5/blob/main/3_analise.ipynb"
click node_charts "https://github.com/soumadriano/trabalho-final-t5/blob/main/3_analise.ipynb"
click node_connection "https://github.com/soumadriano/trabalho-final-t5/blob/main/banco.py"
click node_configuration "https://github.com/soumadriano/trabalho-final-t5/blob/main/config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extract,node_raw toneBlue
class node_transform,node_silver toneAmber
class node_gold,node_business,node_charts toneMint
class node_schema,node_connection,node_configuration toneRose
class node_portal,node_drive toneIndigo
```

## Components

### Extraction and Raw

- [Download and load](https://github.com/soumadriano/trabalho-final-t5/blob/main/1_extrair.py): `1_extrair.py`
- [Raw tables](https://github.com/soumadriano/trabalho-final-t5/blob/main/0_criar_banco.sql): `0_criar_banco.sql`

### Silver Transformation

- [Clean and type](https://github.com/soumadriano/trabalho-final-t5/blob/main/2_transformar.py): `2_transformar.py`
- [Silver tables](https://github.com/soumadriano/trabalho-final-t5/blob/main/0_criar_banco.sql): `0_criar_banco.sql`

### Gold Analysis

- [Gold tables and views](https://github.com/soumadriano/trabalho-final-t5/blob/main/3_analise.ipynb): `3_analise.ipynb`
- [Business questions](https://github.com/soumadriano/trabalho-final-t5/blob/main/3_analise.ipynb): `3_analise.ipynb`
- [Charts and results](https://github.com/soumadriano/trabalho-final-t5/blob/main/3_analise.ipynb): `3_analise.ipynb`

### Shared Infrastructure

- [Database schema](https://github.com/soumadriano/trabalho-final-t5/blob/main/0_criar_banco.sql): `0_criar_banco.sql`
- [PostgreSQL connection](https://github.com/soumadriano/trabalho-final-t5/blob/main/banco.py): `banco.py`
- [Runtime configuration](https://github.com/soumadriano/trabalho-final-t5/blob/main/config.py): `config.py`

### Other components

- **Travel data source**
- **Google Drive**

## Connections

- Travel data source → Google Drive: publishes data (evidence: `README.md`)
- Google Drive → Download and load: provides ZIP (evidence: `1_extrair.py`)
- Download and load → Raw tables: loads CSVs (evidence: `1_extrair.py`)
- Database schema → Raw tables: defines tables (evidence: `README.md`)
- Database schema → Silver tables: defines tables (evidence: `README.md`)
- Download and load → PostgreSQL connection: connects via (evidence: `1_extrair.py`)
- Clean and type → Raw tables: reads blocks (evidence: `2_transformar.py`)
- Clean and type → Silver tables: converts and loads (evidence: `2_transformar.py`)
- Clean and type → PostgreSQL connection: connects via (evidence: `2_transformar.py`)
- Silver tables → Gold tables and views: aggregates from (evidence: `README.md`)
- Gold tables and views → Business questions: answers (evidence: `README.md`)
- Business questions → Charts and results: visualizes results (evidence: `README.md`)
- PostgreSQL connection → Runtime configuration: reads credentials (evidence: `banco.py`)
- Download and load → Runtime configuration: reads settings (evidence: `1_extrair.py`)
- Clean and type → Runtime configuration: reads batch size (evidence: `2_transformar.py`)
