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 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 ValueError for invalid coordinates or coordinates outside Sweden
  • Returns not_on_land=True for water areas, offshore=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.3.1.tar.gz (19.4 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.3.1-py3-none-any.whl (19.4 MB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for duva-0.3.1.tar.gz
Algorithm Hash digest
SHA256 c01cdb80aa3d28f4d137d79287bd33390f6538950bae02074f65ea4bc9037620
MD5 1534c164d84923616550d00f6565258c
BLAKE2b-256 7066b3b8fc2aaca9f2dedff3bc5fdaf004e0231f0f0624e8ffc88cf4ef771258

See more details on using hashes here.

Provenance

The following attestation bundles were made for duva-0.3.1.tar.gz:

Publisher: python-publish.yml on Koutakis/duva

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

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

Hashes for duva-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad99d3ccd2a8a7bdef0e38f7efee2c07319c802252a414d4bce93cb988c0b29b
MD5 3ac8d91ee6019f8144b74bc922baf1db
BLAKE2b-256 c3d3c3d5b735624491ef2cd6436733fe220df8dca331b400f4c91e89fbd99193

See more details on using hashes here.

Provenance

The following attestation bundles were made for duva-0.3.1-py3-none-any.whl:

Publisher: python-publish.yml on Koutakis/duva

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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