Metadata-Version: 2.5
Name: dataportalen
Version: 0.7.1
Summary: dataportal.se as plain Python dicts: DCAT-AP-SE metadata with vocabulary URIs resolved to labels
Project-URL: Homepage, https://github.com/nordicintel/dataportal
Project-URL: Documentation, https://docs.dataportal.se/registry/api/
Author: Nordic Intel
License: MIT
License-File: LICENSE
Keywords: dataportal,dcat,dcat-ap-se,entrystore,open-data,rdf,sweden
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: requests>=2.25
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: ruff>=0.16; extra == 'dev'
Description-Content-Type: text/markdown

# dataportalen

Python access to [dataportal.se](https://www.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](https://docs.dataportal.se/registry/api/), your
problem.

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

## Install

```bash
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

```python
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](docs/guide.md)** — how to use it, in the order you hit it:
  searching, discovering filters, reading a result, recipes.
- **[docs/reference.md](docs/reference.md)** — every method, filter, record key
  and error, as tables.
- **[docs/internals.md](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](LICENSE), with the details in
[docs/internals.md](docs/internals.md).

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