cbspy
A modern Python client for CBS Statline open data that returns Polars DataFrames with human-readable column names.
- Github repository: https://github.com/thomaspinder/cbspy/
- Documentation: https://thomaspinder.github.io/cbspy/
Installation
pip install cbspy
Quick Start
import cbspy
client = cbspy.Client()
# Discover available tables
tables = client.list_tables(language="en")
print(tables.head())
# shape: (5, 7)
# id, title, description, period, frequency, record_count, modified
# Inspect a table's structure
meta = client.get_metadata("37296eng")
for col in meta.properties:
print(f"{col.id}: {col.display_name} ({col.unit})")
# Fetch data with human-readable column names
df = client.get_data("37296eng")
print(df.head())
# Columns like "Total population", "Males", "Females" instead of
# "TotalPopulation_1", "Males_2", "Females_3"
# Filter by time period
df = client.get_data("37296eng", periods=["2022JJ00", "2023JJ00"])
Development
make install # Create venv and install pre-commit hooks
make test # Run tests with coverage
make check # Run linting and type checking
Repository initiated with fpgmaas/cookiecutter-uv.
Metadata
Release files for cbspy 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cbspy-0.0.4.tar.gz | 148.5 kB | Without provenance | Details for cbspy-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cbspy-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for cbspy-0.0.4-py3-none-any.whl |
Total release size: 156.3 kB
Release files / cbspy-0.0.4.tar.gz
| Download URL | cbspy-0.0.4.tar.gz |
|---|---|
| Size | 148.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2493bf2364a6e34b6d932c1c04e9e7c2635fe375c041fbaeb24213b3e3ba59e7
|
|
BLAKE2b-256 checksum How to use checksums |
25fcb721ee8152cf0f0272e7bc9daa97a43dc98f2d431c11425966365f88171b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cbspy-0.0.4-py3-none-any.whl
| Download URL | cbspy-0.0.4-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b3d68019dd32a3465d30d35a08f4e68ed0c1e9bbabaf3cba8549a3514fc6cdf
|
|
BLAKE2b-256 checksum How to use checksums |
478142a04ef8388b151f4cb90e5b2fb84ba6ae97520bebbda31314e2ffbbd995
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for cbspy 0.0.4
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.