# renanmpeixoto/resiliencia-arvore-rio architecture

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

- Interactive diagram: https://gitdiagram.com/renanmpeixoto/resiliencia-arvore-rio
- Repository: https://github.com/renanmpeixoto/resiliencia-arvore-rio

## Overview

This repository is an urban-tree maintenance and climate-risk analysis project for Rio de Janeiro, not a deployed service. Its principal workflow extracts 1746 service-call data from BigQuery, analyzes preventive pruning, regional service times, pre-event backlog, and storm-related tree falls, then presents findings and recommendations. A separate Python script cleans a supplied CSV and produces regional summary tables. The README documents the analytical capabilities and workflow; source excerpts verify the script’s behavior, but the notebook and SQL query bodies were not inspected.

Main entry points: [`notebooks/analise_exploratoria_1746.ipynb`](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/notebooks/analise_exploratoria_1746.ipynb) (Exploratory analysis), [`scripts/pipeline_resiliencia_urbana.py`](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/scripts/pipeline_resiliencia_urbana.py) (Data cleaning and aggregation), [`sql/01_extracao_preventiva_2023.sql`](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/sql/01_extracao_preventiva_2023.sql) (Preventive extraction), [`sql/02_extracao_estresse_2026.sql`](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/sql/02_extracao_estresse_2026.sql) (Storm extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extraction["Data extraction"]
  node_preventive_query["Preventive extraction"]
  node_stress_query["Storm extraction"]
end

subgraph group_analysis["Risk analysis"]
  node_notebook["Exploratory analysis"]
  node_findings["Risk findings"]
  node_charts["Analysis charts"]
end

subgraph group_processing["CSV processing"]
  node_raw_csv["Input CSV"]
  node_pipeline["Data cleaning and aggregation"]
  node_cleaned_csv["Harmonized calls"]
  node_regional_table["Regional summary"]
end

node_analyst(("Analyst"))
node_bigquery[("BigQuery")]

node_analyst -->|"runs query"| node_preventive_query
node_analyst -->|"runs query"| node_stress_query
node_preventive_query -->|"queries"| node_bigquery
node_stress_query -->|"queries"| node_bigquery
node_analyst -->|"runs analysis"| node_notebook
node_notebook -->|"evaluates"| node_findings
node_notebook -->|"produces"| node_charts
node_raw_csv -->|"is read by"| node_pipeline
node_pipeline -->|"writes"| node_cleaned_csv
node_pipeline -->|"writes"| node_regional_table

click node_preventive_query "https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/sql/01_extracao_preventiva_2023.sql"
click node_stress_query "https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/sql/02_extracao_estresse_2026.sql"
click node_notebook "https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/notebooks/analise_exploratoria_1746.ipynb"
click node_findings "https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/notebooks/analise_exploratoria_1746.ipynb"
click node_charts "https://github.com/renanmpeixoto/resiliencia-arvore-rio/tree/main/outputs"
click node_pipeline "https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/scripts/pipeline_resiliencia_urbana.py"
click node_cleaned_csv "https://github.com/renanmpeixoto/resiliencia-arvore-rio/tree/main/outputs"
click node_regional_table "https://github.com/renanmpeixoto/resiliencia-arvore-rio/tree/main/outputs"

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_preventive_query,node_stress_query toneBlue
class node_notebook,node_findings,node_charts,node_bigquery toneAmber
class node_raw_csv,node_pipeline,node_cleaned_csv,node_regional_table toneMint
class node_analyst toneIndigo
```

## Components

### Data extraction

- [Preventive extraction](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/sql/01_extracao_preventiva_2023.sql): `sql/01_extracao_preventiva_2023.sql`
- [Storm extraction](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/sql/02_extracao_estresse_2026.sql): `sql/02_extracao_estresse_2026.sql`

### Risk analysis

- [Exploratory analysis](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/notebooks/analise_exploratoria_1746.ipynb): `notebooks/analise_exploratoria_1746.ipynb`
- [Risk findings](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/notebooks/analise_exploratoria_1746.ipynb): `notebooks/analise_exploratoria_1746.ipynb`
- [Analysis charts](https://github.com/renanmpeixoto/resiliencia-arvore-rio/tree/main/outputs): `outputs`

### CSV processing

- **Input CSV**
- [Data cleaning and aggregation](https://github.com/renanmpeixoto/resiliencia-arvore-rio/blob/main/scripts/pipeline_resiliencia_urbana.py): `scripts/pipeline_resiliencia_urbana.py`
- [Harmonized calls](https://github.com/renanmpeixoto/resiliencia-arvore-rio/tree/main/outputs): `outputs`
- [Regional summary](https://github.com/renanmpeixoto/resiliencia-arvore-rio/tree/main/outputs): `outputs`

### Other components

- **Analyst**
- **BigQuery**

## Connections

- Analyst → Preventive extraction: runs query (evidence: `README.md`)
- Analyst → Storm extraction: runs query (evidence: `README.md`)
- Preventive extraction → BigQuery: queries (evidence: `README.md`)
- Storm extraction → BigQuery: queries (evidence: `README.md`)
- Analyst → Exploratory analysis: runs analysis (evidence: `README.md`)
- Exploratory analysis → Risk findings: evaluates (evidence: `README.md`)
- Exploratory analysis → Analysis charts: produces (evidence: `README.md`)
- Input CSV → Data cleaning and aggregation: is read by (evidence: `scripts/pipeline_resiliencia_urbana.py`)
- Data cleaning and aggregation → Harmonized calls: writes (evidence: `scripts/pipeline_resiliencia_urbana.py`)
- Data cleaning and aggregation → Regional summary: writes (evidence: `scripts/pipeline_resiliencia_urbana.py`)
