Skip to main content

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

Open In Colab

Installation

pip install czso

Or with uv:

uv add czso

Quick start

📓 See demo.ipynb for 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 (default 0)
  • force_redownload — skip cache and re-download
  • dest_dir — directory for caching downloaded files
  • clean — drop code columns, rename to friendly names (default True)
  • 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

Metadata

Release files for czso 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for czso 0.1.0
File Size Uploaded
czso-0.1.0.tar.gz 90.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for czso 0.1.0
File Interpreter ABI Platform
czso-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 98.5 kB

Release files / czso-0.1.0.tar.gz

Download URL czso-0.1.0.tar.gz
Size 90.2 kB
Tags Source
SHA-256 checksum
How to use checksums
668a4a89c6529cf7dda8615aecad08e3c7539730c34e3a25b48f1b3360750af1
BLAKE2b-256 checksum
How to use checksums
f192135e0613d8a3dd06c3f4524c73eed9ee6effd0584f48de0fb93065e2f740
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

Release files / czso-0.1.0-py3-none-any.whl

Download URL czso-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2b115036f9a0ed930a8302143bf2a5e2220af38bcf242def1d66a0fdd0b617f
BLAKE2b-256 checksum
How to use checksums
821941f0f08b26d38e9175183602d9eda8cbe6ed78d7c6e41470e69c5319d621
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page