Python wrapper around Open Data from the Czech Statistical Office
Project description
czso
Python wrapper around Open Data from the Czech Statistical Office (CZSO).
The real credit goes to CZSO for publishing hundreds of machine-readable datasets with proper metadata and codelists.
Inspired by the R package by Petr Bouchal: petrbouchal/czso
Installation
pip install czso
Or with uv:
uv add czso
Quick start
📓 See
demo.ipynbfor an interactive walkthrough — browse the catalogue, download datasets, plot wages over time, and explore codelists.
import czso
# Browse available datasets
catalogue = czso.get_catalogue()
print(catalogue[["dataset_id", "title"]].head())
# Download a dataset as a DataFrame
df = czso.get_table("110079")
# Get dataset with metadata
df, meta = czso.get_table("110079", include_metadata=True)
print(meta["title"])
# Get raw (uncleaned) data
df_raw = czso.get_table("110079", clean=False)
# Retrieve a codelist (číselník)
codelist = czso.get_codelist(100)
API
| Function | Description |
|---|---|
get_catalogue() |
Full catalogue of available CZSO open datasets |
get_table(dataset_id, ...) |
Download and read a dataset as a DataFrame |
get_dataset_metadata(dataset_id) |
JSON-LD metadata for a dataset |
get_table_schema(dataset_id) |
JSON table schema for a dataset resource |
get_codelist(codelist_id) |
Retrieve a CZSO codelist (číselník) |
get_table options
resource_num— which resource to download (default0)force_redownload— skip cache and re-downloaddest_dir— directory for caching downloaded filesclean— drop code columns, rename to friendly names (defaultTrue)include_metadata— return(DataFrame, metadata_dict)tuple
AI coding skill
This repo includes a skill that teaches AI coding agents how to use the czso package. Install it with:
npx skills add https://github.com/Marigold/czso --skill czso-data
Related projects
- mcp-csu — MCP server for the CZSO DataStat API. Gives AI assistants (Claude, etc.) direct access to 700+ statistical datasets. Run with
uvx mcp-csu. - petrbouchal/czso — R package for CZSO open data (the inspiration for this project).
Development
make .venv # install all deps (including dev: ruff, ty, pytest)
make format # auto-format with ruff
make lint # lint + fix with ruff
make check-typing # typecheck with ty
make test # format + lint + typecheck + unit tests
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file czso-0.1.0.tar.gz.
File metadata
- Download URL: czso-0.1.0.tar.gz
- Upload date:
- Size: 90.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
668a4a89c6529cf7dda8615aecad08e3c7539730c34e3a25b48f1b3360750af1
|
|
| MD5 |
7997e1813d26000c510417ee4f91de10
|
|
| BLAKE2b-256 |
f192135e0613d8a3dd06c3f4524c73eed9ee6effd0584f48de0fb93065e2f740
|
Provenance
The following attestation bundles were made for czso-0.1.0.tar.gz:
Publisher:
publish.yml on Marigold/czso
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
czso-0.1.0.tar.gz -
Subject digest:
668a4a89c6529cf7dda8615aecad08e3c7539730c34e3a25b48f1b3360750af1 - Sigstore transparency entry: 1203477291
- Sigstore integration time:
-
Permalink:
Marigold/czso@be47547a58327e2718477c42a46ca15e608d2bba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Marigold
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be47547a58327e2718477c42a46ca15e608d2bba -
Trigger Event:
release
-
Statement type:
File details
Details for the file czso-0.1.0-py3-none-any.whl.
File metadata
- Download URL: czso-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2b115036f9a0ed930a8302143bf2a5e2220af38bcf242def1d66a0fdd0b617f
|
|
| MD5 |
43b6ec8fa67ce461dacfa5a3cd94a57c
|
|
| BLAKE2b-256 |
821941f0f08b26d38e9175183602d9eda8cbe6ed78d7c6e41470e69c5319d621
|
Provenance
The following attestation bundles were made for czso-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Marigold/czso
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
czso-0.1.0-py3-none-any.whl -
Subject digest:
f2b115036f9a0ed930a8302143bf2a5e2220af38bcf242def1d66a0fdd0b617f - Sigstore transparency entry: 1203477294
- Sigstore integration time:
-
Permalink:
Marigold/czso@be47547a58327e2718477c42a46ca15e608d2bba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Marigold
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be47547a58327e2718477c42a46ca15e608d2bba -
Trigger Event:
release
-
Statement type: