Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions datasets/eurostat-poverty-risk-nuts2/dataset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
root: "../../out"
schema_version: 1

dataset:
name: "eurostat_poverty_risk_nuts2"
source_id: "eurostat"
years: [2026]
time_coverage:
start_year: 2003
end_year: 2025

raw:
output_policy: overwrite
sources:
- name: "eurostat_ilc_li41"
type: "script"
args:
command: "../../connectors/tsv_normalize.py --flow ILC_LI41 --output ilc_li41_normalized.parquet"
output: "ilc_li41_normalized.parquet"
filename: "ilc_li41_normalized.parquet"
primary: true

clean:
sql: "sql/clean.sql"
read:
source: auto
mode: latest
delim: ","
encoding: utf-8
header: true
validate:
min_rows: 100

mart:
tables:
- name: "mart_eurostat_poverty_risk_nuts2"
sql: "sql/mart.sql"
required_tables:
- "mart_eurostat_poverty_risk_nuts2"

validation:
fail_on_error: true

registry:
dataflow: "ILC_LI41"
theme: "At-risk-of-poverty rate by NUTS 2 region"
nuts_level: 2
dimensions: ["freq", "unit", "geo"]
description: "At-risk-of-poverty rate by NUTS 2 region"
21 changes: 21 additions & 0 deletions datasets/eurostat-poverty-risk-nuts2/sql/clean.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- clean.sql: ILC_LI41 — rischio povertà per regione NUTS2
SELECT
r.freq,
r.unit,
r.geo,
r.year,
f.label_en AS freq_label_en,
u.label_en AS unit_label_en,
g.label_en AS geo_label_en,
g.nuts_level,
g.parent_code AS nuts_parent_code,
gp.label_en AS nuts_parent_label_en,
r.value,
r.flag,
fl.description_en AS flag_desc_en
FROM raw_input r
LEFT JOIN read_csv('codelists/freq.csv', auto_detect=true, delim=',', header=true) f ON r.freq = f.freq
LEFT JOIN read_csv('codelists/units.csv', auto_detect=true, delim=',', header=true) u ON r.unit = u.unit
LEFT JOIN read_csv('codelists/geo.csv', auto_detect=true, delim=',', header=true) g ON r.geo = g.code
LEFT JOIN read_csv('codelists/flags.csv', auto_detect=true, delim=',', header=true) fl ON r.flag = fl.flag
LEFT JOIN read_csv('codelists/geo.csv', auto_detect=true, delim=',', header=true) gp ON g.parent_code = gp.code
20 changes: 20 additions & 0 deletions datasets/eurostat-poverty-risk-nuts2/sql/mart.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- mart.sql: Rischio povertà NUTS2 — Italia
SELECT
year,
geo,
geo_label_en,
nuts_level,
nuts_parent_code,
nuts_parent_label_en,
freq,
freq_label_en,
unit,
unit_label_en,
value,
flag,
flag_desc_en
FROM clean_input
WHERE geo LIKE 'IT%'
AND nuts_level = 'NUTS2'
AND value IS NOT NULL
ORDER BY year DESC, geo
1 change: 1 addition & 0 deletions docs/dataset-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
| `eurostat-area-nuts3` | `REG_AREA3` | Geography / Area by land use category | 4 (freq, landuse, unit, geo) | 65,240 | ✅ |
| `eurostat-physicians-nuts2` | `HLTH_RS_PHYSREG` | Health / Physicians by NUTS2 region | 3 (freq, unit, geo) | 27,360 | ✅ |
| `eurostat-hospital-beds-nuts2` | `HLTH_RS_BDSRG2` | Health / Available beds in hospitals by NUTS2 region | 3 (freq, unit, geo) | 25,888 | ✅ |
| `eurostat-poverty-risk-nuts2` | `ILC_LI41` | Social / At-risk-of-poverty rate by NUTS2 region | 3 (freq, unit, geo) | 9,016 | ✅ |
| `eurostat-fertility-nuts3` | `DEMO_R_FIND3` | Demography / Fertility indicators | 4 (freq, indic_de, unit, geo) | 76,392 | ✅ |
| `eurostat-business-demography-nuts3` | `BD_SIZE_R3` | Business / Business demography by size class | 5 (freq, indic_sb, sizeclas, nace_r2, geo) | 120,955 | ✅ |

Expand Down