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
# 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")
Notes
- Input coordinates must be WGS84 (standard GPS)
- Raises
ValueErrorfor invalid coordinates or coordinates outside Sweden - Returns
not_on_land=Truefor water areas,offshore=Truefor international water - 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
duva-0.2.2.tar.gz
(19.3 MB
view details)
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
duva-0.2.2-py3-none-any.whl
(19.4 MB
view details)
File details
Details for the file duva-0.2.2.tar.gz.
File metadata
- Download URL: duva-0.2.2.tar.gz
- Upload date:
- Size: 19.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2c7132086480eea56092a78f81540ee2ce8a792b74027819f7abb8c509a3253
|
|
| MD5 |
3b0b5e867057b3a303073c22084dab33
|
|
| BLAKE2b-256 |
38e293d0260dabf97c526b892bed9eaf33f8450911535efedc1dd2b46cf29e0c
|
File details
Details for the file duva-0.2.2-py3-none-any.whl.
File metadata
- Download URL: duva-0.2.2-py3-none-any.whl
- Upload date:
- Size: 19.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a3b89e71abfcfcc61e759a896cb44f03451f0ac417191d7e12e1400041e555f
|
|
| MD5 |
7e5672c0b9fb37d538f12440d2209f59
|
|
| BLAKE2b-256 |
90050f679e03404d84440abd0e8de5d445226f3a5470fc162a774d331bcdc983
|