How timolsoft/countries_information_ingestion works
This repository is a country-data ELT pipeline for travel-destination analytics. Its main workflow extracts country attributes from REST Countries, validates row counts, loads a BigQuery staging table, and builds a dimensional warehouse; Airflow owns that scheduled flow. The README also documents a dbt modeling path, a local PostgreSQL alternative, and ad-hoc analytics queries. The Airflow, extraction, and BigQuery load implementations were sampled; dbt internals and individual SQL queries were not, so those links reflect README statements only.
Main entry points: country_pipeline_dag.py Airflow DAG · extract.py Country extraction · load.py BigQuery loader · stg_country_data.sql dbt staging view
Components 15
Ingestion
- Country extraction
api/extract.py - BigQuery loader
api/load.py - Cloud Storage bucket
- Postgres alternative
api/load2db.py - Local PostgreSQL
Orchestration
- Airflow DAG
airflow/dags/country_pipeline_dag.py - Row-count gate
airflow/dags/country_pipeline_dag.py - Warehouse build
airflow/dags/country_pipeline_dag.py
Warehouse
- BigQuery staging
api/load.py - Star schema
airflow/dags/country_pipeline_dag.py - dbt staging view
country_data/models/staging/stg_country_data.sql - dbt dimensions
country_data/models/warehouse - dbt country fact
country_data/models/warehouse/fact_country.sql
Analytics
- Analytics queries
Top 2 countries with the largest Area for each continent.sql
Other components
- REST Countries API
Connections 17
- Airflow DAG → Country extraction: calls extraction
airflow/dags/country_pipeline_dag.py - Airflow DAG → Row-count gate: runs validation
airflow/dags/country_pipeline_dag.py - Airflow DAG → BigQuery loader: calls loader
airflow/dags/country_pipeline_dag.py - Airflow DAG → Warehouse build: runs build task
airflow/dags/country_pipeline_dag.py - Country extraction → REST Countries API: fetches country data
api/extract.py - Airflow DAG → Country extraction: re-extracts for load
airflow/dags/country_pipeline_dag.py - Airflow DAG → Row-count gate: passes row counts
airflow/dags/country_pipeline_dag.py - BigQuery loader → Cloud Storage bucket: ensures bucket
api/load.py - BigQuery loader → BigQuery staging: truncates and loads
api/load.py - Warehouse build → BigQuery staging: reads staging data
airflow/dags/country_pipeline_dag.py - Warehouse build → Star schema: creates tables
airflow/dags/country_pipeline_dag.py - BigQuery staging → dbt staging view: feeds staging model
README.md - dbt staging view → dbt dimensions: feeds dimensions
README.md - dbt staging view → dbt country fact: feeds fact model
README.md - Postgres alternative → Country extraction: calls extraction
api/load2db.py - Postgres alternative → Local PostgreSQL: loads locally
README.md - Analytics queries → Star schema: queries warehouse
README.md