Publicly available data files for reading in a DuckDB database or other tools
Find a file
2026-07-19 12:02:18 +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
calling_codes.csv feat: add international calling codes and ISO 639 language datasets 2026-07-19 11:18:36 +02:00
countries.csv feat: add capital, TLD and currency columns to countries 2026-07-19 11:43:47 +02:00
currencies.csv feat: add ISO 4217 currencies dataset 2026-07-18 19:18:36 +02:00
einwohner_at.csv feat: add German, Austrian and Swiss population figures datasets 2026-07-19 11:04:28 +02:00
einwohner_ch.csv feat: add German, Austrian and Swiss population figures datasets 2026-07-19 11:04:28 +02:00
einwohner_de.csv feat: add German, Austrian and Swiss population figures datasets 2026-07-19 11:04:28 +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
languages.csv feat: add international calling codes and ISO 639 language datasets 2026-07-19 11:18:36 +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: link to project landing page 2026-07-19 12:02:18 +02:00
vorwahlen_at.csv feat: add Austrian telephone area codes dataset 2026-07-19 10:36:09 +02:00
vorwahlen_ch.csv feat: add Swiss telephone area codes dataset 2026-07-19 10:37: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 Website

Publicly available data files. All files are UTF-8 encoded, comma-separated and use LF line endings. An overview of every dataset is available at jakoubek.net/publicdata.

Available files

Countries of the world

Based on ISO 3166-1. 249 entries. capital, tld and currency_code are added from GeoNames (see Sources below); currency_code links to currencies.csv, and the international dialing code is in calling_codes.csv. A few uninhabited territories (e.g. Antarctica) have no capital and are left blank.

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)
capital Capital city (English name; blank if none)
tld Country-code top-level domain (e.g. .de)
currency_code ISO 4217 currency code — links to currencies.csv

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)

International calling codes

ITU country calling codes for 248 countries/territories. alpha_2 links to countries.csv. Codes are the official country codes, so countries sharing a code carry the same value (all NANP territories are +1; Russia and Kazakhstan are +7). The United States Minor Outlying Islands (UM) have no distinct code and are not listed.

Column Description
alpha_2 ISO 3166-1 alpha-2 code — links to countries.csv
name English short name
calling_code International calling code including leading + (e.g. +49)

Languages (ISO 639)

486 languages from ISO 639-2. Where a language has a two-letter code (ISO 639-1) it is given in alpha_2 (183 languages); alpha_3 uses the terminologic code (ISO 639-2/T, matching ISO 639-3 — e.g. German is deu, not ger). Special codes such as mul (multiple), und (undetermined) and zxx (no linguistic content) are included.

Column Description
alpha_2 ISO 639-1 two-letter code (empty if none)
alpha_3 ISO 639-2/T three-letter code
name English language name

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 population figures (Einwohnerzahlen)

Population, area and density for all 10,943 German municipalities (census 2022 basis, as of 31 Dec 2024). ags_code links to gemeinden_de.csv. Unincorporated areas (gemeindefreie Gebiete) can have a population of 0 while still having an area. Source: Destatis (see Sources below).

Column Description
ags_code Municipality key (AGS, 8 digits) — links to gemeinden_de.csv
population Inhabitants (as of 31 Dec 2024)
area_km2 Area in km²
density Inhabitants per km²

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

Austrian population figures (Einwohnerzahlen)

Population for all 2,092 Austrian municipalities (as of 1 Jan 2026). gkz links to gemeinden_at.csv (Vienna's 23 districts are summed into the single municipality 90001). Source: Statistik Austria (see Sources below).

Column Description
gkz Municipality code (Gemeindekennziffer, 5 digits) — links to gemeinden_at.csv
population Inhabitants (as of 1 Jan 2026)

Austrian telephone area codes (Vorwahlen)

All 1,022 Austrian local dialing codes (Ortsnetzkennzahlen). Source: RTR (see Sources below).

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

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

Swiss population figures (Einwohnerzahlen)

Permanent resident population (ständige Wohnbevölkerung) for all 2,131 Swiss municipalities (as of 31 Dec 2024). bfs_nr links to gemeinden_ch.csv. Source: BFS (see Sources below).

Column Description
bfs_nr Official BFS municipality number — links to gemeinden_ch.csv
population Permanent resident population (as of 31 Dec 2024)

Swiss telephone area codes (Vorwahlen)

The 20 Swiss geographic area codes. Since the 2002 closed numbering plan Switzerland no longer has town-level dialing codes; each code covers a whole region and often spans several cantons (e.g. 032 covers Bern, Solothurn, Neuchâtel and Jura), so region is a descriptive label rather than a key. Source: BAKOM numbering plan (see Sources below).

Column Description
vorwahl Dialing code including leading 0 (e.g. 044 for Zürich)
region Region / cantons covered by the code

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.