How rianmaia/obrasgov-data-pipeline works
ObrasGov Data Pipeline collects four public-data domains, stores raw JSON in PostgreSQL Bronze, transforms records through dbt Silver into project-level Gold analytics, and presents them in a Streamlit dashboard. The principal workflow and dashboard capabilities are documented in the README; ingestion calls and persistence are visible in the sampled Python source. dbt model internals were not sampled, so the documented layer transitions are shown without inferring model-to-model joins beyond the stated project-level aggregation.
Main entry points: 002_create_bronze_tables.sql Bronze raw records · fact_project_summary.sql Project summary fact · main.py Ingestion runner · projects.sql Silver projects
Components 15
Ingestion
- Ingestion runner
ingestion/src/main.py - Paged API client
ingestion/src/api_client.py - Runtime configuration
ingestion/src/config.py - Bronze persistence
ingestion/src/database.py
Warehouse
- PostgreSQL
- Bronze raw records
database/init/002_create_bronze_tables.sql - Silver projects
dbt/models/silver/projects.sql - Silver investments
dbt/models/silver/project_investments.sql - Silver execution
dbt/models/silver/physical_execution.sql - Silver commitments
dbt/models/silver/commitments.sql - Silver contracts
dbt/models/silver/contracts.sql
Analytics
- Project dimension
dbt/models/gold/dim_project.sql - Project summary fact
dbt/models/gold/fact_project_summary.sql
Dashboard
- Analytical dashboard
dashboard/app.py
Other components
- ObrasGov API
Connections 19
- Ingestion runner → Runtime configuration: loads settings
ingestion/src/main.py - Ingestion runner → Paged API client: fetches pages
ingestion/src/main.py - Paged API client → ObrasGov API: requests pages
ingestion/src/api_client.py - Ingestion runner → Bronze persistence: saves records
ingestion/src/main.py - Bronze persistence → PostgreSQL: writes Bronze
ingestion/src/database.py - PostgreSQL → Bronze raw records: stores raw JSON
- Bronze raw records → Silver projects: types records
README.md - Bronze raw records → Silver investments: types records
README.md - Bronze raw records → Silver execution: types records
README.md - Bronze raw records → Silver commitments: types records
README.md - Bronze raw records → Silver contracts: types records
README.md - Silver projects → Project dimension: models projects
- Silver projects → Project summary fact: aggregates projects
README.md - Silver investments → Project summary fact: aggregates investments
README.md - Silver execution → Project summary fact: summarizes execution
README.md - Silver commitments → Project summary fact: aggregates commitments
README.md - Silver contracts → Project summary fact: aggregates contracts
README.md - Project dimension → Analytical dashboard: queries projects
README.md - Project summary fact → Analytical dashboard: queries summaries
dashboard/app.py