Skip to main content

dataportalen

Python access to dataportal.se that gives you plain dicts, not RDF.

Sweden's open-data registry describes its 23,500 datasets in RDF, which means every value arrives as a web address: a dataset about roads is filed under http://publications.europa.eu/resource/authority/data-theme/TRAN rather than under "transport". Working out that it means "transport" is, per the registry's own documentation, your problem.

This package makes it not your problem. You search with words and you get dictionaries back.

Install

pip install dataportalen

Distribution and import name are both dataportalen. The unrelated dataportal package on PyPI is a Korean public-data client — not this.

Quick start

from dataportalen import Catalog, text

cat = Catalog()          # downloads the catalogue the first time: ~7 min, 64 MB
print(cat.info())        # {'datasets': 23576, 'data_services': 599, ...}

page = cat.datasets(theme="transport", format="csv")
print(page.total)                               # 67

for dataset in page:
    print(text(dataset["title"]), text(dataset["publisher"]["name"]))
    for dist in dataset["distributions"]:
        print("   ", dist["format"], dist["access_url"])

That first line takes about seven minutes. It downloads the whole catalogue once, and every search after that is local and takes hundredths of a second. Run it deliberately the first time — it prints a progress line.

Documentation

  • docs/guide.md — how to use it, in the order you hit it: searching, discovering filters, reading a result, recipes.
  • docs/reference.md — every method, filter, record key and error, as tables.
  • docs/internals.md — how it is built: the short values, the module layout, development, releasing.

Licence

Code is MIT. The bundled label table is third-party data redistributed under CC BY 4.0 and EU Decision 2011/833/EU; both notices are in LICENSE, with the details in docs/internals.md.

Metadata you retrieve is published by its respective publishers, each under its own licence — check the license field on the dataset.

Metadata

Release files for dataportalen 0.7.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 dataportalen 0.7.0
File Size Uploaded Provenance
dataportalen-0.7.0.tar.gz 157.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 250.4 kB

Release files / dataportalen-0.7.0.tar.gz

Download URL dataportalen-0.7.0.tar.gz
Size 157.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4aabc60fec69c3f82404d2c62c5f5b0c8c302ba3ac3848c7d89cdf1f3c56930c
BLAKE2b-256 checksum
How to use checksums
ed2ded4122344aeef4bad0c0705b8f22c74a67a4c5b604b90021d835a1d4cefc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / dataportalen-0.7.0-py3-none-any.whl

Download URL dataportalen-0.7.0-py3-none-any.whl
Size 93.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b09cceebce305efaf9e1b36c8b71d02e078e8f42333957f6741d3e3e074edafb
BLAKE2b-256 checksum
How to use checksums
636303d29a36141cf01b9954837f1447d9974c1ef81b957f92f70bcf086eae65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for dataportalen 0.7.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.

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.

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