Publicly available data files for reading in a DuckDB database or other tools
Find a file
2026-07-18 21:00:44 +02:00
.gitattributes build: normalize CSV line endings to LF via .gitattributes 2026-07-18 19:12:06 +02:00
bundeslaender_at.csv refactor: switch existing dataset column headers to English 2026-07-18 19:18:35 +02:00
bundeslaender_de.csv refactor: switch existing dataset column headers to English 2026-07-18 19:18:35 +02:00
countries.csv feat: add ISO 3166-1 countries dataset 2026-07-18 19:18:35 +02:00
currencies.csv feat: add ISO 4217 currencies dataset 2026-07-18 19:18:36 +02:00
gemeinden_at.csv feat: add Austrian and Swiss municipalities datasets 2026-07-18 21:00:44 +02:00
gemeinden_ch.csv feat: add Austrian and Swiss municipalities datasets 2026-07-18 21:00:44 +02:00
gemeinden_de.csv feat: add German municipalities dataset 2026-07-18 20:44:06 +02:00
kantone_ch.csv refactor: switch existing dataset column headers to English 2026-07-18 19:18:35 +02:00
kfz_kennzeichen_de.csv feat: add German vehicle registration plate codes dataset 2026-07-18 19:49:10 +02:00
landkreise_de.csv fix: strip redundant type prefix from district names 2026-07-18 19:26:16 +02:00
LICENSE chore: relicense from MIT to CC BY 4.0 2026-07-18 20:35:06 +02:00
postleitzahlen_at.csv feat: add Austrian and Swiss postal codes datasets 2026-07-18 20:54:34 +02:00
postleitzahlen_ch.csv feat: add Austrian and Swiss postal codes datasets 2026-07-18 20:54:34 +02:00
postleitzahlen_de.csv feat: add German postal codes dataset 2026-07-18 20:28:35 +02:00
README.md docs: document Austrian and Swiss municipalities 2026-07-18 21:00:44 +02:00
vorwahlen_de.csv feat: add German telephone area codes dataset 2026-07-18 20:39:33 +02:00

publicdata

License: CC BY 4.0

Publicly available data files. All files are UTF-8 encoded, comma-separated and use LF line endings.

Available files

Countries of the world

Based on ISO 3166-1. 249 entries.

Column Description
name English short name
alpha_2 ISO 3166-1 alpha-2 code
alpha_3 ISO 3166-1 alpha-3 code
numeric ISO 3166-1 numeric code (3 digits, zero-padded)
region Continental region (UN M49)
sub_region Sub-region (UN M49)

Currencies

Active currencies based on ISO 4217. 178 entries.

Column Description
code ISO 4217 alphabetic code
numeric ISO 4217 numeric code (3 digits, zero-padded)
name Currency name
minor_unit Number of decimal digits (- if not applicable, e.g. gold)

German Bundesländer

Column Description
name Name of the federal state
ags_code Official Amtlicher Gemeindeschlüssel land code (2 digits, zero-padded)
iso_3166_2 ISO 3166-2 subdivision code

German districts (Landkreise)

All 400 German districts. state_code equals the first two digits of ags_code and links to ags_code in bundeslaender_de.csv.

Column Description
name Name of the district
ags_code Official Amtlicher Gemeindeschlüssel district code (5 digits, zero-padded)
type Landkreis, Kreis, Kreisfreie Stadt or Stadtkreis
state_code Land code of the federal state (2 digits)
state_name Name of the federal state

German municipalities (Gemeinden)

All 10,943 German municipalities (including unincorporated areas). The first five digits of ags_code equal kreis_code and link to ags_code in landkreise_de.csv; the first two digits give the Bundesland. (A few special entries — e.g. the Sonderstatusstadt Hanau and two unincorporated maritime areas — use district-region codes not present in the standard district list.) Source: Destatis (see Sources below).

Column Description
ags_code Official municipality key (AGS, 8 digits)
name Municipality name
kreis_code District code (first 5 digits of ags_code) — links to landkreise_de.csv
bundesland Federal state

German postal codes (Postleitzahlen)

8,293 German delivery postal codes with their primary city. ags_code is the 5-digit district code and links to ags_code in landkreise_de.csv; its first two digits give the Bundesland. Institutional large-recipient codes (Großempfänger) are excluded. Sources: GeoNames + WZB (see Sources below).

Column Description
plz Postal code (5 digits)
ort Primary city / town
bundesland Federal state (derived from ags_code)
ags_code District code (AGS, 5 digits) — links to landkreise_de.csv

German vehicle registration plate codes

All 769 currently listed German Unterscheidungszeichen (the letters at the start of a licence plate). Source: Kraftfahrt-Bundesamt (see Sources below).

Column Description
code Distinguishing sign (13 letters)
area Assigned city / district (Stadt / Kreis)

German telephone area codes (Vorwahlen)

All 5,200 active German local dialing codes (Ortsnetzkennzahlen).

Column Description
vorwahl Dialing code including leading 0 (e.g. 030)
ort Local network name (Ortsnetzname)

Austrian Bundesländer

Column Description
name Name of the federal state
oestat_code Official Statistics Austria land code (1 digit)
iso_3166_2 ISO 3166-2 subdivision code

Austrian postal codes (Postleitzahlen)

2,501 Austrian postal codes as postal-code/municipality pairs (4,391 rows — a code may cover several municipalities, so plz is not unique). bundesland matches name in bundeslaender_at.csv. Source: GeoNames (see Sources below).

Column Description
plz Postal code (4 digits)
ort Municipality (Gemeinde)
bundesland Federal state

Austrian municipalities (Gemeinden)

All 2,092 Austrian municipalities. The first digit of gkz gives the Bundesland, the first three digits equal bezirk_code (political district). bundesland matches name in bundeslaender_at.csv. Source: Statistik Austria (see Sources below).

Column Description
gkz Municipality code (Gemeindekennziffer, 5 digits)
name Municipality name
bezirk_code District code (first 3 digits of gkz)
bundesland Federal state

Swiss Kantone

Column Description
name Name of the canton
abbreviation Official two-letter canton abbreviation
iso_3166_2 ISO 3166-2 subdivision code

Swiss postal codes (Postleitzahlen)

3,362 Swiss postal codes as postal-code/municipality pairs (3,629 rows — a code may cover several municipalities, so plz is not unique). kanton matches name in kantone_ch.csv (normalised to German). Source: GeoNames (see Sources below).

Column Description
plz Postal code (4 digits)
ort Municipality (Gemeinde)
kanton Canton

Swiss municipalities (Gemeinden)

All 2,131 Swiss municipalities (territorial status 01.01.2024). bfs_nr is the official Federal Statistical Office number. kanton matches name in kantone_ch.csv (normalised to German). Source: BFS (see Sources below).

Column Description
bfs_nr Official BFS municipality number
name Municipality name
bezirk District (Bezirk, official local-language name)
kanton Canton

Integrate in DuckDB

Read a file directly from its raw URL. Keep the code columns as VARCHAR so zero-padded values (e.g. the German ags_code 08) are preserved:

SELECT *
FROM read_csv(
    'https://code.beautifulmachines.dev/jakoubek/publicdata/raw/branch/main/bundeslaender_de.csv',
    header = true,
    all_varchar = true
);

A local file works the same way:

SELECT * FROM read_csv('bundeslaender_de.csv', header = true, all_varchar = true);

Sources

The data is compiled from official / public reference sources. Factual reference data of this kind is not protected by copyright; source credits are given where requested by the publisher.

License

This work is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0).

© 2026 Oliver Jakoubek. You are free to share and adapt the data for any purpose, provided you give appropriate credit. Attribution requirements of individual data sources (see Sources above) remain in effect.