Skip to main content

dataseries: Switzerland's Data Series in One Place

PyPI CI

Download and import open Swiss economic time series from dataseries.org, a comprehensive and up-to-date collection of public data from Switzerland. The package talks to the public dataseries.org API and imports series as pandas DataFrames.

An R package with the same interface is available on CRAN.

Installation

pip install dataseries

Requires Python ≥ 3.9 and pandas.

Data model

Data on dataseries.org is organized into datasets. A dataset is a family of related series and, in most cases, a multi-dimensional cube — a single time series is one cell of that cube, addressed by the dataset plus one code per dimension. For example the GDP dataset (ch_seco_gdp) splits along three dimensions: type (nominal/real/…), structure (GDP, value added, …) and seas_adj (seasonally adjusted or not).

  • ds_catalog() lists every dataset.
  • ds_search(pattern) is a flat, searchable list of the individual series.
  • ds_meta(id) describes a dataset's dimensions and the codes within them.
  • ds(id, ...) downloads series.

Usage

import dataseries

# Browse what's available
dataseries.ds_catalog()

# Find a specific series across all datasets
dataseries.ds_search("unemployment")

# A dataset's dimensions and codes
dataseries.ds_meta("ch_seco_gdp")

# Whole dataset (long DataFrame)
dataseries.ds("ch_fso_cpi")

# One series: pass dimension codes as keyword arguments
dataseries.ds("ch_fso_cpi", item="100_100")

# Several series, restricted to a date range
dataseries.ds("ch_fso_cpi", item=["100_100", "100_1"], start="2020-01-01")

# One cell of a multi-dimensional cube, as a wide DataFrame indexed by date
dataseries.ds("ch_seco_gdp", type="real", structure="gdp", seas_adj="csa",
              wide=True)

The long format (the default) has the dimension column(s), then date (datetime) and value (float) — ready for groupby, seaborn or plotly. wide=True pivots to one column per series with a DatetimeIndex, the shape you want for .plot() or statsmodels. All series are regular (annual, quarterly or monthly); convert with e.g. .to_period("Q") if you prefer a PeriodIndex.

Dimension arguments are optional: omit them and you get the whole dataset. Filtering happens on the server, so selecting one series does not download the whole cube. Downloads are cached in memory for the session; dataseries.cache_clear() forces a fresh download.

Labels in German, French or Italian

The catalog and search index are translated. Pass lang to get titles and labels in any Swiss national language (falls back to English where a translation is missing):

dataseries.ds_catalog(lang="de")
dataseries.ds_search("arbeitslosigkeit", lang="de")

From search hit to data

ds_search() returns exactly the columns you feed back to ds():

hits = dataseries.ds_search("consumer price")
row = hits.iloc[0]
df = dataseries.ds(row["dataset"], {row["dim"]: row["code"]})

Beyond Python

Every series is also available as a plain CSV from any tool that can read a URL:

https://api.dataseries.org/series.csv?dataset=ch_fso_cpi&dims=item=100_100

Self-hosting or testing against a mirror? Point the package elsewhere with the DATASERIES_API environment variable.

License

MIT. The data itself is published by the Swiss data providers under their respective terms; see the license column in ds_catalog() and the source links in ds_meta().

Metadata

Release files for dataseries 1.0.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 dataseries 1.0.0
File Size Uploaded
dataseries-1.0.0.tar.gz 11.5 kB Details

Built distribution (wheel)

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

Total release size: 21.8 kB

Release files / dataseries-1.0.0.tar.gz

Download URL dataseries-1.0.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9293917bb7257afe6884cf6c07bd68a42b5d6cec80f5537bef230800d5d764cf
BLAKE2b-256 checksum
How to use checksums
efbcd7698e5155ce328e8f0c356aba8aa9dc922ff6dc9a71763c666770da98de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 7, 2026.

Transparency log

Release files / dataseries-1.0.0-py3-none-any.whl

Download URL dataseries-1.0.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dc9499ea05931d32981289bc75485da6722380412fc785dafd5d9f6874862f6
BLAKE2b-256 checksum
How to use checksums
9b21a024d1996dc08cba7e8a4a0770af67b5588a704f012b665c1291fd5f069e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.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