No project description provided
Project description
duva 🕊️
Reverse geocode Swedish coordinates to RegSO areas.
Install
pip install duva
Usage
from duva import locate, locate_many, enrich_df, from_code, from_name, search
# Single coordinate (WGS84)
locate(x=17.88, y=59.35)
# {'regsonamn': 'Blackeberg', 'kommunnamn': 'Stockholm', 'lansnamn': 'Stockholms län', ...}
# As object
result = locate(x=17.88, y=59.35, as_object=True)
result.regsonamn # 'Blackeberg'
# List of coordinates
locate_many([(17.88, 59.35), (18.07, 59.28)])
# Enrich a Polars DataFrame
enrich_df(df, x_col="lon", y_col="lat")
# Lookup by RegSO code
from_code("0180R009")
# Lookup by name (returns list since names are not unique across Sweden)
from_name("Blackeberg")
from_name("Östermalm") # returns all areas named Östermalm across Sweden
# Search by partial name with optional kommun/län filters
search("östermalm")
search("östermalm", kommunnamn="Borlänge")
search("centrum", lansnamn="Stockholms län")
search("centrum", kommunnamn="Sollentuna", lansnamn="Stockholms län")
RegSO object
RegSO object
| Field | Type | Example | Description |
|---|---|---|---|
regsokod |
str |
0180R009 |
SCB area code |
regsonamn |
str |
Blackeberg |
Area name |
kommunkod |
str |
0180 |
Municipality code |
kommunnamn |
str |
Stockholm |
Municipality name |
lanskod |
str |
01 |
County code |
lansnamn |
str |
Stockholms län |
County name |
not_on_land |
bool |
False |
True if coordinate is over water |
offshore |
bool |
False |
True if outside any municipality boundary (international water) |
objektidentitet |
str |
141f6a1d-... |
SCB internal UUID |
objekttyp |
str |
regso |
Always regso |
version |
str |
2025_v2 |
Dataset version |
referensdatum |
str |
20250101 |
Dataset reference date |
Notes
- Input coordinates must be WGS84 (standard GPS)
- Raises
ValueErrorfor invalid coordinates or coordinates outside Sweden - Area names are not unique across Sweden —
from_nameandsearchreturn lists - Based on SCB's RegSO 2025 and municipality boundaries
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duva-0.3.3.tar.gz.
File metadata
- Download URL: duva-0.3.3.tar.gz
- Upload date:
- Size: 19.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d358dd1eed1e73bf6a9903e2aecfeb6c4c934893a87acbaef6b4d1f92481d0e
|
|
| MD5 |
fd8601eeb46bc1920d47c7c43b05d571
|
|
| BLAKE2b-256 |
143056d74061b446689a41766dd43e2dfaac40fb9b601f1406964f2f1b01dd3a
|
Provenance
The following attestation bundles were made for duva-0.3.3.tar.gz:
Publisher:
python-publish.yml on Koutakis/duva
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
duva-0.3.3.tar.gz -
Subject digest:
3d358dd1eed1e73bf6a9903e2aecfeb6c4c934893a87acbaef6b4d1f92481d0e - Sigstore transparency entry: 1790177924
- Sigstore integration time:
-
Permalink:
Koutakis/duva@3ec4718df8c33a0c9b0d58f96c501397768a4cec -
Branch / Tag:
refs/tags/0.3.3 - Owner: https://github.com/Koutakis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3ec4718df8c33a0c9b0d58f96c501397768a4cec -
Trigger Event:
release
-
Statement type:
File details
Details for the file duva-0.3.3-py3-none-any.whl.
File metadata
- Download URL: duva-0.3.3-py3-none-any.whl
- Upload date:
- Size: 19.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97fd1e8ad48221d7537cd9cb498c4a7d2fda3b73c7bf532f2f2b7e24b84589fb
|
|
| MD5 |
aa3c6e676834532c85bbb1f65191ef6c
|
|
| BLAKE2b-256 |
7ac51f4329f776aadc64b1cf188f9f93d83d6360a5cb6774a66fbc570a826b36
|
Provenance
The following attestation bundles were made for duva-0.3.3-py3-none-any.whl:
Publisher:
python-publish.yml on Koutakis/duva
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
duva-0.3.3-py3-none-any.whl -
Subject digest:
97fd1e8ad48221d7537cd9cb498c4a7d2fda3b73c7bf532f2f2b7e24b84589fb - Sigstore transparency entry: 1790177946
- Sigstore integration time:
-
Permalink:
Koutakis/duva@3ec4718df8c33a0c9b0d58f96c501397768a4cec -
Branch / Tag:
refs/tags/0.3.3 - Owner: https://github.com/Koutakis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3ec4718df8c33a0c9b0d58f96c501397768a4cec -
Trigger Event:
release
-
Statement type: