Skip to content

cbspy

Release Build status codecov License

A modern Python client for CBS Statline open data that returns Polars DataFrames with human-readable column names.

Features

  • Discover and search available CBS datasets
  • Inspect table metadata and column definitions
  • Fetch data as Polars DataFrames with resolved column names
  • Automatic period code decoding (e.g. 2023KW01 becomes 2023 Q1)
  • Bilingual support (English and Dutch column names)

Installation

pip install cbspy

Or with uv:

uv add cbspy

Quick example

import cbspy

client = cbspy.Client()

# Fetch population data with human-readable columns
df = client.get_data("37296eng", periods=["2023JJ00"])
print(df)

See the Getting Started guide for a full walkthrough, or explore the Interactive Examples.