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.2.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.2-py3-none-any.whl (19.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: duva-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 af06faee240755d192d08fd9ffc7d357b5e7e625329412a745d17c3a05bdb981
MD5 7ac52d6a95a03d4f3591b61a32cad480
BLAKE2b-256 572c260786595f053f6d1ea18f7be317fa17e7f8ffce77ceafe959d0bc38c8bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for duva-0.3.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: duva-0.3.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8639cb5190791196d7e6a42f567c921380f20520eb80366d1106e81b87b7e3e0
MD5 119d233c77729fcb82cd97186432b688
BLAKE2b-256 568fbbd535262effac2b231326d623527752cb867058fc5378594ceddb831f6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for duva-0.3.2-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