# 🍷🚬 100+ Års Synder: Danskernes Forbrug af Alkohol & Tobak (1921–2025) / Alcohol & Tobacco Consumption in Denmark

[![Kilde](https://img.shields.io/badge/kilde-Danmarks%20Statistik-blue.svg)](https://www.statbank.dk/)
[![Licens: CC BY 4.0](https://img.shields.io/badge/licens-CC%20BY%204.0-green.svg)](https://creativecommons.org/licenses/by/4.0/deed.da)
[![Tidsspænd: 1921-2025](https://img.shields.io/badge/periode-1921--2025-orange.svg)](#)

[🇩🇰 Dansk](#dansk) | [🇬🇧 English](#english)

---

<a name="dansk"></a>
## 🇩🇰 Dansk

Dette datasæt kortlægger over **et helt århundredes udvikling (1921–2025)** i danskernes officielle salg og forbrug af alkohol (øl, vin, spiritus) samt tobak (cigaretter, cigarer, røgtobak), herunder grænsehandelsestimater fra 2000–2020.

Tallene tegner et levende kulturhistorisk billede af Danmark: Fra mellemkrigstidens beskedne forbrug og 1970'ernes/1980'ernes historiske rekordforbrug (med et toppunkt i **1983 på 13,7 liter ren alkohol** pr. voksen) til det markante fald i tobaksrygning (fra næsten 2.000 cigaretter årligt pr. voksen til blot 723 i 2025) samt danskernes transformation fra en rendyrket ølnation til vinelskere (vinsalget er 35-doblet siden 1921).

---

### 📊 Centrale nøgletal fra datasættet

| Årstal | Ren alkohol pr. voksen (18+ år) | Salg af vin (1.000 L) | Salg af øl/pilsnere (1.000 L) | Cigaretter pr. voksen (stk) | Historisk kontekst |
| :--- | :--- | :--- | :--- | :--- | :--- |
| **1921** | 4,5 liter | 4.900 | 149.500 | *Ikke opgjort* | Mellemkrigstid, afholdsbevægelse |
| **1950** | 4,9 liter | 12.750 | 218.400 | 1.408 stk | Efterkrigstid |
| **1970** | 9,7 liter | 29.070 | 443.200 | 1.917 stk | Rødvinshjulet ruller for alvor i gang |
| **1983** | **13,7 liter** *(Absolut rekord)* | 96.463 | 647.795 | **1.931 stk** | Toppen af dansk alkohol- & rygekultur |
| **2000** | 12,2 liter | 165.033 | 557.500 | 1.686 stk | Grænsehandlen topper, vin overhaler øl i ren alkohol |
| **2010** | 10,8 liter | 175.388 | 415.540 | 1.783 stk | Rygelovgivning og sundhedskampagner |
| **2020** | 9,7 liter | 161.493 | 355.101 | 1.140 stk | Corona-nedlukninger |
| **2025** | **8,8 liter** | 141.134 | 298.441 | **723 stk** | Laveste tobaksforbrug og støt faldende alkohol |

---

### 📂 Filer i dette datasæt

Hver tidsserie leveres i både CSV- og JSON-format for nem integration i analyseværktøjer og webapplikationer:

- **`alkohol_tobak_historisk_1921_2025_bred`** [`CSV`](alkohol_tobak_historisk_1921_2025_bred.csv) [`JSON`](alkohol_tobak_historisk_1921_2025_bred.json)
  - **Type**: Bred pivot-tabel (1 række pr. kalenderår, 105 rækker i alt).
  - **Beskrivelse**: Samler de vigtigste nøgletal for ren alkohol, øl, vin, spiritus, tobaksvarianter og grænsehandel i overskuelige kolonner. Perfekt til grafer, dashboards og hurtige tidsserieanalyser.
- **`alkohol_tobak_tidsserie_lang`** [`CSV`](alkohol_tobak_tidsserie_lang.csv) [`JSON`](alkohol_tobak_tidsserie_lang.json)
  - **Type**: Normaliseret (tidy) lang tidsserie (3.870 rækker).
  - **Beskrivelse**: Indeholder detaljerede felter med kildetabel, variabelkode, kategori, enhed, årstal og målt værdi. Ideel til filtrering, gruppering og modellering med pandas, R/tidyverse og SQL.

---

### ⚙️ Genopfriskning & API-høst

Data udtrækkes fra Danmarks Statistiks officielle API (`api.statbank.dk/v1`) via et medfølgende Python-script med fair-use metadata-caching:

```bash
# Kræver Python 3 samt requests-biblioteket:
pip install requests

# Kør høstningsscriptet:
python fetch_data.py
```

Før data downloades, tjekker scriptet Danmarks Statistiks tabelmetadata (`/v1/tableinfo/{tabel}`) for seneste opdateringstidspunkt (`updated`). Hvis metadata stemmer overens med den lokale cache i `.cache/`, genbruges de lokale data uden overflødig serverbelastning.

---

### 📜 Kilde og Licens

- **Kilde**: [Danmarks Statistik (Statistikbanken)](https://www.statbank.dk/)
  - Tabel `ALKO2`: Salg af alkohol og tobak pr. indbygger (1921–2025)
  - Tabel `ALKO6`: Salg af alkohol og tobak (1921–2025)
  - Tabel `ALKO4`: Forbrug og salg af alkohol og tobak (1921–2020)
- **Licens**: [Creative Commons Navngivelse (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/deed.da).
  Data stilles til rådighed af Danmarks Statistik til fri kommerciel og ikke-kommerciel genanvendelse med krav om kildeangivelse.

---

<a name="english"></a>
## 🇬🇧 English

This dataset charts more than **a full century (1921–2025)** of official sales and consumption trends for alcoholic beverages (beer, wine, spirits) and tobacco products (cigarettes, cigars, pipe tobacco) in Denmark, including cross-border trade estimates from 2000–2020.

The statistics reveal major cultural and demographic shifts: from low consumption during the interwar era to historic all-time highs in the 1970s and 1980s (peaking in **1983 at 13.7 liters of pure alcohol** per adult), alongside a dramatic drop in cigarette smoking (from nearly 2,000 cigarettes annually per adult to just 723 in 2025) and Denmark's transformation from a beer-centric nation to a wine-loving one (wine sales increased 35-fold since 1921).

---

### 📊 Key Historical Figures

| Year | Pure alcohol per adult (18+) | Wine sales (1,000 L) | Beer sales (1,000 L) | Cigarettes per adult (pcs) | Historical Context |
| :--- | :--- | :--- | :--- | :--- | :--- |
| **1921** | 4.5 liters | 4,900 | 149,500 | *Not recorded* | Interwar temperance era |
| **1950** | 4.9 liters | 12,750 | 218,400 | 1,408 pcs | Post-WWII recovery |
| **1970** | 9.7 liters | 29,070 | 443,200 | 1,917 pcs | Wine boom begins |
| **1983** | **13.7 liters** *(All-time peak)* | 96,463 | 647.795 | **1,931 pcs** | Zenith of Danish drinking & smoking |
| **2000** | 12.2 liters | 165,033 | 557,500 | 1,686 pcs | Peak border trade; wine overtakes beer |
| **2010** | 10.8 liters | 175,388 | 415,540 | 1,783 pcs | Smoking bans & public health campaigns |
| **2020** | 9.7 liters | 161,493 | 355,101 | 1,140 pcs | COVID-19 pandemic impacts |
| **2025** | **8.8 liters** | 141,134 | 298,441 | **723 pcs** | Lowest tobacco usage & steadily falling alcohol |

---

### 📂 Files in this Dataset

Every series is provided in both CSV and JSON formats:

- **`alkohol_tobak_historisk_1921_2025_bred`** [`CSV`](alkohol_tobak_historisk_1921_2025_bred.csv) [`JSON`](alkohol_tobak_historisk_1921_2025_bred.json)
  - **Type**: Wide pivot table (1 row per year, 105 rows in total).
  - **Description**: Gathers core metrics for pure alcohol, beer, wine, spirits, tobacco products, and border trade in convenient columns. Ideal for charts, dashboards, and rapid time-series analysis.
- **`alkohol_tobak_tidsserie_lang`** [`CSV`](alkohol_tobak_tidsserie_lang.csv) [`JSON`](alkohol_tobak_tidsserie_lang.json)
  - **Type**: Tidy normalized long format (3,870 rows).
  - **Description**: Features detailed metadata fields (source table, variable code, category, unit, year, and recorded value). Tailored for filtering, aggregation, and statistical modeling in pandas, R/tidyverse, and SQL.

---

### ⚙️ Reproduction & Harvester

Data is queried directly from Statistics Denmark's official API (`api.statbank.dk/v1`) using the included Python script with conditional caching:

```bash
# Requires Python 3 and requests:
pip install requests

# Execute harvester:
python fetch_data.py
```

Before pulling records, the script queries metadata (`/v1/tableinfo/{table}`) for the latest `updated` timestamp. If it matches the cached copy in `.cache/`, cached data is reused to protect server resources.

---

### 📜 Source & License

- **Source**: [Statistics Denmark (StatBank Denmark)](https://www.statbank.dk/)
  - Table `ALKO2`: Sales of alcohol and tobacco per capita (1921–2025)
  - Table `ALKO6`: Sales of alcohol and tobacco (1921–2025)
  - Table `ALKO4`: Consumption and sales of alcohol and tobacco (1921–2020)
- **License**: [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/).
  Provided by Statistics Denmark for free commercial and non-commercial reuse with attribution.
