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

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.1
File Size Uploaded Provenance
dataportalen-0.7.1.tar.gz 158.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 251.3 kB

Release files / dataportalen-0.7.1.tar.gz

Download URL dataportalen-0.7.1.tar.gz
Size 158.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d2c346bb40918db0f12fc6c874f28471ad4d05199082b30c90d3c5e4af91d09b
BLAKE2b-256 checksum
How to use checksums
35646cafe5c164cf4e18e3f4c7f12f0052e92c570a08ff184e111f2a04c16c65
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.1-py3-none-any.whl

Download URL dataportalen-0.7.1-py3-none-any.whl
Size 93.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
736ec2bca98ea75a63674bb1a677b0b35ecc02cebfb1f7927b00089c8b2626ae
BLAKE2b-256 checksum
How to use checksums
7fda1e728ff085d1dd0d1b8819002bf1227eafd7e801643b4399ef0f9a39fc9c
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.1

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