Skip to main content

sistat

A small Python client for SiStat, the statistical database of the Statistical Office of the Republic of Slovenia (SURS). Use it to search tables, inspect their variables, and download data as plain records, ready for pandas, polars or anything else.

SiStat runs PxWeb, whose v1 API is documented in SURS's API help (PDF).

Install

pip install sistat

Its only dependency is httpx.

Usage

import sistat

c = sistat.Client(lang="en")          # or "sl"

c.search("air temperatures")          # case- and accent-insensitive, searched locally
# [TableInfo(id='0156101S.px', text='Average annual and monthly air temperatures [°C] by ...', ...)]

meta = c.metadata("0156101S")         # the ".px" suffix is optional
for v in meta.variables:
    print(v.code, "|", v.text, "|", v.value_texts[:3])
# METEOROLOŠKA POSTAJA | METEOROLOGICAL STATION | ('SLOVENIA', 'Bilje', 'Bovec')
# OBDOBJE, LETO | PERIOD, YEAR | ('1981-1990', '1991-2000', '2001-2010')
# MERITVE | MEASURE | ('Average temperature - ANNUAL', 'January', 'February')

records = c.get_records(
    "0156101S",
    {
        "METEOROLOGICAL STATION": ["Ljubljana, Bežigrad", "Maribor, Tabor"],
        "PERIOD, YEAR": "201*",
    },
)
# [{'METEOROLOGICAL STATION': 'Ljubljana, Bežigrad', 'PERIOD, YEAR': '2010',
#   'MEASURE': 'Average temperature - ANNUAL', 'value': 10.7}, ...]

import pandas as pd                   # or polars: pl.DataFrame(records)
df = pd.DataFrame(records)
#   METEOROLOGICAL STATION  PERIOD, YEAR                       MEASURE  value
# 0    Ljubljana, Bežigrad          2010  Average temperature - ANNUAL   10.7
# ...

Selections

Keys are variables, given as their code (often Slovenian, even in the English API) or their label, case-insensitively. Values can be:

Selection Meaning
"Ljubljana, Bežigrad" or "10" one value, by label or code
["10", "Maribor, Tabor"] several values
"2020*", "*" glob pattern over codes and labels
"top:5" the first 5 values in the table's order

The library sends every variable you leave out with all its values selected. PxWeb would otherwise drop it from the result without telling you.

Pass codes=True to also get a <variable>_code key with the raw value codes. Queries that exceed the server's cell limit are split into several requests and merged. Requests are kept under the server's rate limit automatically.

Layout

  • sistat.pxweb: a generic PxWeb v1 client that works on its own: PxWebClient.get_records(table, selections) resolves selections by label or code, splits queries at the server's cell limit, rate-limits, and returns merged records. It never imports from the SiStat layer, so it could be split into its own package.
  • sistat.Client: SiStat specifics such as the base URL, table-id normalisation, cached table search.

Development

uv sync
uv run pytest            # offline tests against recorded fixtures
uv run pytest -m live    # hits the real API
uv run ruff check .

Data © SURS, see their terms of use.

Metadata

Release files for sistat 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 sistat 0.1.0
File Size Uploaded Provenance Actions
sistat-0.1.0.tar.gz 18.1 kB With provenance Details for sistat-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 32.9 kB

Release files / sistat-0.1.0.tar.gz

Download URL sistat-0.1.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6586869afd8c4667d1b454fd97c9266f5c603a260c59e166fc827e7fa92e1fdd
BLAKE2b-256 checksum
How to use checksums
864dfacf852db4b01988518d0b3864d2c2b37b46c921f5edb41d7cc968649d5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

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

Download URL sistat-0.1.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f54453137740eb4efd53a8984898ec815c118afe5b7590117c0bb26fd18f986
BLAKE2b-256 checksum
How to use checksums
d5b343581c86a814ac374b0ef7467369f1c1fe8f35173c436189ed9323c90545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for sistat 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sistat-0.1.0.tar.gz

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 Nov 19, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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