Skip to main content

No project description provided

Project description

duva 🕊️

Reverse geocode Swedish coordinates to RegSO areas.

Install

pip install duva

Usage

from duva import duva, duva_many, duva_df, duva_from_kod

# Single coordinate (WGS84)
duva(x=17.88, y=59.35)
# {'regsonamn': 'Blackeberg', 'kommunnamn': 'Stockholm', 'lansnamn': 'Stockholms län', ...}

# As object
result = duva(x=17.88, y=59.35, as_object=True)
result.regsonamn  # 'Blackeberg'

# List of coordinates
duva_many([(17.88, 59.35), (18.07, 59.28)])

# Enrich a Polars DataFrame
duva_df(df, x_col="lon", y_col="lat")

# Lookup by RegSO code
duva_from_kod("0180R009")

Notes

  • Input coordinates must be WGS84 (standard GPS)
  • Raises ValueError for invalid coordinates or coordinates outside Sweden
  • Returns not_on_land=True for water areas, is_baltic=True for international water
  • Based on SCB's RegSO 2025 and municipality boundaries

Project details


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.1.tar.gz (19.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duva-0.2.1-py3-none-any.whl (19.4 MB view details)

Uploaded Python 3

File details

Details for the file duva-0.2.1.tar.gz.

File metadata

  • Download URL: duva-0.2.1.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

Hashes for duva-0.2.1.tar.gz
Algorithm Hash digest
SHA256 12eb4ebd09bae395058fc918e3b072e625e301bef6bd77af9d044e9d895161a0
MD5 eb45fa95b746dd405305ac69a3366f4c
BLAKE2b-256 9c1e24e9a69e559d0768135bd5cd49ac5444bd5241756b15db25754abba06428

See more details on using hashes here.

File details

Details for the file duva-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: duva-0.2.1-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

Hashes for duva-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f923dcfa9fe155218e0385aa77ebcb942c2db91e2823bbff864510b7670f61c
MD5 fef06142b3ec4fb2b218cde9872531ea
BLAKE2b-256 ba26886b82e38f34fe86151ab54733526801d47140b4c7e05ceee2fb287a9b6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page