# nycdepartmentoffinance/github_actions_demo architecture

> Architecture diagram of the GitHub repository nycdepartmentoffinance/github_actions_demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nycdepartmentoffinance/github_actions_demo
- Repository: https://github.com/nycdepartmentoffinance/github_actions_demo

## Overview

This repository’s product is a Python geospatial extraction and transformation workflow: a user selects a geography and polygon or centroid output, the CLI invokes extraction from ArcGIS Online, normalizes and validates geometries, optionally remaps lot BBLs, and writes compressed GeoParquet for Python or R consumers. The README also documents neighborhood extraction from a local shapefile and scheduled or manually triggered updates; the sampled query implementation does not show how that neighborhood path is wired, so it is represented as a documented optional input without inferred call edges.

Main entry points: [`query.py`](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py) (ArcGIS extraction), [`output`](https://github.com/nycdepartmentoffinance/github_actions_demo/tree/main/output) (GeoParquet files), [`.github/workflows/main.yml`](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/.github/workflows/main.yml) (Scheduled updates), [`python_maps.ipynb`](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/python_maps.ipynb) (Python mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Invocation"]
  node_cli["CLI<br/>[query.py]"]
  node_workflow["Scheduled updates<br/>[main.yml]"]
end

subgraph group_transform["Geospatial transformation"]
  node_extract["ArcGIS extraction<br/>[query.py]"]
  node_geography["Geography selection<br/>[query.py]"]
  node_centroids["Centroid option<br/>[query.py]"]
  node_validation["Geometry validation<br/>[query.py]"]
  node_crosswalk["Lot BBL crosswalk<br/>[query.py]"]
end

subgraph group_output["GeoParquet outputs"]
  node_parquet[("GeoParquet files")]
end

subgraph group_consumption["Data consumption"]
  node_python["Python mapping<br/>[python_maps.ipynb]"]
  node_r["R mapping<br/>[R_maps.Rmd]"]
end

node_user(("Data user"))
node_arcgis[("ArcGIS Online")]
node_neighborhoods["Neighborhood shapefile"]

node_user -->|"selects options"| node_cli
node_cli -->|"invokes"| node_extract
node_extract -->|"selects level"| node_geography
node_extract -->|"queries layers"| node_arcgis
node_extract -->|"requests option"| node_centroids
node_extract -->|"validates geometries"| node_validation
node_extract -->|"queries for lots"| node_crosswalk
node_crosswalk -->|"reads table"| node_arcgis
node_extract -->|"writes files"| node_parquet
node_user -->|"reads files"| node_parquet
node_parquet -->|"loads data"| node_python
node_parquet -->|"loads data"| node_r
node_workflow -.->|"runs updates"| node_cli
node_neighborhoods -.->|"documented input"| node_extract

click node_cli "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py"
click node_extract "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py"
click node_geography "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py"
click node_centroids "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py"
click node_validation "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py"
click node_crosswalk "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py"
click node_parquet "https://github.com/nycdepartmentoffinance/github_actions_demo/tree/main/output"
click node_python "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/python_maps.ipynb"
click node_r "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/R_maps.Rmd"
click node_workflow "https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/.github/workflows/main.yml"

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_cli,node_workflow,node_user toneBlue
class node_extract,node_geography,node_centroids,node_validation,node_crosswalk,node_arcgis toneAmber
class node_parquet toneMint
class node_python,node_r toneRose
class node_neighborhoods toneIndigo
```

## Components

### Invocation

- [CLI](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py): `query.py`
- [Scheduled updates](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/.github/workflows/main.yml): `.github/workflows/main.yml`

### Geospatial transformation

- [ArcGIS extraction](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py): `query.py`
- [Geography selection](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py): `query.py`
- [Centroid option](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py): `query.py`
- [Geometry validation](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py): `query.py`
- [Lot BBL crosswalk](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/query.py): `query.py`

### GeoParquet outputs

- [GeoParquet files](https://github.com/nycdepartmentoffinance/github_actions_demo/tree/main/output): `output`

### Data consumption

- [Python mapping](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/python_maps.ipynb): `python_maps.ipynb`
- [R mapping](https://github.com/nycdepartmentoffinance/github_actions_demo/blob/main/R_maps.Rmd): `R_maps.Rmd`

### Other components

- **Data user**
- **ArcGIS Online**
- **Neighborhood shapefile**

## Connections

- Data user → CLI: selects options
- CLI → ArcGIS extraction: invokes
- ArcGIS extraction → Geography selection: selects level
- ArcGIS extraction → ArcGIS Online: queries layers
- ArcGIS extraction → Centroid option: requests option
- ArcGIS extraction → Geometry validation: validates geometries
- ArcGIS extraction → Lot BBL crosswalk: queries for lots
- Lot BBL crosswalk → ArcGIS Online: reads table
- ArcGIS extraction → GeoParquet files: writes files
- Data user → GeoParquet files: reads files
- GeoParquet files → Python mapping: loads data
- GeoParquet files → R mapping: loads data
- Scheduled updates → CLI: runs updates
- Neighborhood shapefile → ArcGIS extraction: documented input
