Skip to main content

osm-shortlink

PyPI - Python Version

Encode and decode OpenStreetMap shortlink codes from Python 3.11 or newer. The API uses explicit (longitude, latitude, zoom) arguments.

Installation

pip install osm-shortlink

Basic usage

from osm_shortlink import shortlink_decode, shortlink_encode

code = shortlink_encode(0.055, 51.511, 9)
assert code == '0EEQjE--'

lon, lat, zoom = shortlink_decode(code)
assert (lon, lat, zoom) == (0.054931640625, 51.510772705078125, 9)

The decoded coordinate is the grid-aligned location represented by the code, not a bit-for-bit copy of the input. In this example it identifies the cell containing longitude 0.055 and latitude 51.511.

Coordinate and code behavior

Longitude and latitude must be finite. Longitude wraps around the world; latitude reflects across either pole and shifts longitude by 180 degrees. The north pole maps to the highest latitude cell. Zoom values from 0 through 22 are supported.

The decoder ignores characters outside its alphabet and accepts the legacy @ and = spellings. It is a shortlink-code decoder, not a complete URL parser. Too-short and too-long encoded values raise ValueError.

Format specification

The OpenStreetMap Shortlink format defines the token and its coordinate quantization.

API reference and support

The two function signatures and behavior are documented in the package typing stubs.

Issues and questions · Private security reports · Premium support

Metadata

Release files for osm-shortlink 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for osm-shortlink 2.0.0
File Size Uploaded Provenance Actions
osm_shortlink-2.0.0.tar.gz 1.5 MB With provenance Details for osm_shortlink-2.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for osm-shortlink 2.0.0
File Actions
osm_shortlink-2.0.0-cp315-cp315t-win_arm64.whl CPython 3.15 CPython 3.15 free-threading Windows ARM64 Details for osm_shortlink-2.0.0-cp315-cp315t-win_arm64.whl
osm_shortlink-2.0.0-cp315-cp315t-win_amd64.whl CPython 3.15 CPython 3.15 free-threading Windows x86-64 Details for osm_shortlink-2.0.0-cp315-cp315t-win_amd64.whl
osm_shortlink-2.0.0-cp315-cp315t-musllinux_1_2_x86_64.whl CPython 3.15 CPython 3.15 free-threading Linux musl 1.2+ x86-64 Details for osm_shortlink-2.0.0-cp315-cp315t-musllinux_1_2_x86_64.whl
osm_shortlink-2.0.0-cp315-cp315t-musllinux_1_2_aarch64.whl CPython 3.15 CPython 3.15 free-threading Linux musl 1.2+ ARM64 Details for osm_shortlink-2.0.0-cp315-cp315t-musllinux_1_2_aarch64.whl
osm_shortlink-2.0.0-cp315-cp315t-manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 free-threading Linux glibc 2.28+ x86-64 Details for osm_shortlink-2.0.0-cp315-cp315t-manylinux_2_28_x86_64.whl
osm_shortlink-2.0.0-cp315-cp315t-manylinux_2_28_aarch64.whl CPython 3.15 CPython 3.15 free-threading Linux glibc 2.28+ ARM64 Details for osm_shortlink-2.0.0-cp315-cp315t-manylinux_2_28_aarch64.whl
osm_shortlink-2.0.0-cp315-cp315t-macosx_11_0_x86_64.whl CPython 3.15 CPython 3.15 free-threading macOS 11.0+ x86-64 Details for osm_shortlink-2.0.0-cp315-cp315t-macosx_11_0_x86_64.whl
osm_shortlink-2.0.0-cp315-cp315t-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64 Details for osm_shortlink-2.0.0-cp315-cp315t-macosx_11_0_arm64.whl
osm_shortlink-2.0.0-cp315-cp315-win_arm64.whl CPython 3.15 CPython 3.15 Windows ARM64 Details for osm_shortlink-2.0.0-cp315-cp315-win_arm64.whl
osm_shortlink-2.0.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for osm_shortlink-2.0.0-cp315-cp315-win_amd64.whl
osm_shortlink-2.0.0-cp315-cp315-musllinux_1_2_x86_64.whl CPython 3.15 CPython 3.15 Linux musl 1.2+ x86-64 Details for osm_shortlink-2.0.0-cp315-cp315-musllinux_1_2_x86_64.whl
osm_shortlink-2.0.0-cp315-cp315-musllinux_1_2_aarch64.whl CPython 3.15 CPython 3.15 Linux musl 1.2+ ARM64 Details for osm_shortlink-2.0.0-cp315-cp315-musllinux_1_2_aarch64.whl
osm_shortlink-2.0.0-cp315-cp315-manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64 Details for osm_shortlink-2.0.0-cp315-cp315-manylinux_2_28_x86_64.whl
osm_shortlink-2.0.0-cp315-cp315-manylinux_2_28_aarch64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ ARM64 Details for osm_shortlink-2.0.0-cp315-cp315-manylinux_2_28_aarch64.whl
osm_shortlink-2.0.0-cp315-cp315-macosx_11_0_x86_64.whl CPython 3.15 CPython 3.15 macOS 11.0+ x86-64 Details for osm_shortlink-2.0.0-cp315-cp315-macosx_11_0_x86_64.whl
osm_shortlink-2.0.0-cp315-cp315-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 macOS 11.0+ ARM64 Details for osm_shortlink-2.0.0-cp315-cp315-macosx_11_0_arm64.whl
osm_shortlink-2.0.0-cp315-abi3.abi3t-win_arm64.whl CPython 3.15 abi3, abi3t Windows ARM64 Details for osm_shortlink-2.0.0-cp315-abi3.abi3t-win_arm64.whl
osm_shortlink-2.0.0-cp315-abi3.abi3t-win_amd64.whl CPython 3.15 abi3t, abi3 Windows x86-64 Details for osm_shortlink-2.0.0-cp315-abi3.abi3t-win_amd64.whl
osm_shortlink-2.0.0-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl CPython 3.15 abi3t, abi3 Linux musl 1.2+ x86-64 Details for osm_shortlink-2.0.0-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl
osm_shortlink-2.0.0-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl CPython 3.15 abi3t, abi3 Linux musl 1.2+ ARM64 Details for osm_shortlink-2.0.0-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl
osm_shortlink-2.0.0-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl CPython 3.15 abi3, abi3t Linux glibc 2.28+ x86-64 Details for osm_shortlink-2.0.0-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl
osm_shortlink-2.0.0-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl CPython 3.15 abi3t, abi3 Linux glibc 2.28+ ARM64 Details for osm_shortlink-2.0.0-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl
osm_shortlink-2.0.0-cp315-abi3.abi3t-macosx_11_0_x86_64.whl CPython 3.15 abi3t, abi3 macOS 11.0+ x86-64 Details for osm_shortlink-2.0.0-cp315-abi3.abi3t-macosx_11_0_x86_64.whl
osm_shortlink-2.0.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl CPython 3.15 abi3t, abi3 macOS 11.0+ ARM64 Details for osm_shortlink-2.0.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl
osm_shortlink-2.0.0-cp314-cp314t-win_arm64.whl CPython 3.14 CPython 3.14 free-threading Windows ARM64 Details for osm_shortlink-2.0.0-cp314-cp314t-win_arm64.whl
osm_shortlink-2.0.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for osm_shortlink-2.0.0-cp314-cp314t-win_amd64.whl
osm_shortlink-2.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 Details for osm_shortlink-2.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl
osm_shortlink-2.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ ARM64 Details for osm_shortlink-2.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl
osm_shortlink-2.0.0-cp314-cp314t-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 Details for osm_shortlink-2.0.0-cp314-cp314t-manylinux_2_28_x86_64.whl
osm_shortlink-2.0.0-cp314-cp314t-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 Details for osm_shortlink-2.0.0-cp314-cp314t-manylinux_2_28_aarch64.whl
osm_shortlink-2.0.0-cp314-cp314t-macosx_11_0_x86_64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ x86-64 Details for osm_shortlink-2.0.0-cp314-cp314t-macosx_11_0_x86_64.whl
osm_shortlink-2.0.0-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details for osm_shortlink-2.0.0-cp314-cp314t-macosx_11_0_arm64.whl
osm_shortlink-2.0.0-cp314-cp314-win_arm64.whl CPython 3.14 CPython 3.14 Windows ARM64 Details for osm_shortlink-2.0.0-cp314-cp314-win_arm64.whl
osm_shortlink-2.0.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for osm_shortlink-2.0.0-cp314-cp314-win_amd64.whl
osm_shortlink-2.0.0-cp314-cp314-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ x86-64 Details for osm_shortlink-2.0.0-cp314-cp314-musllinux_1_2_x86_64.whl
osm_shortlink-2.0.0-cp314-cp314-musllinux_1_2_aarch64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ ARM64 Details for osm_shortlink-2.0.0-cp314-cp314-musllinux_1_2_aarch64.whl
osm_shortlink-2.0.0-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for osm_shortlink-2.0.0-cp314-cp314-manylinux_2_28_x86_64.whl
osm_shortlink-2.0.0-cp314-cp314-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64 Details for osm_shortlink-2.0.0-cp314-cp314-manylinux_2_28_aarch64.whl
osm_shortlink-2.0.0-cp314-cp314-macosx_11_0_x86_64.whl CPython 3.14 CPython 3.14 macOS 11.0+ x86-64 Details for osm_shortlink-2.0.0-cp314-cp314-macosx_11_0_x86_64.whl
osm_shortlink-2.0.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for osm_shortlink-2.0.0-cp314-cp314-macosx_11_0_arm64.whl
osm_shortlink-2.0.0-cp313-cp313-win_arm64.whl CPython 3.13 CPython 3.13 Windows ARM64 Details for osm_shortlink-2.0.0-cp313-cp313-win_arm64.whl
osm_shortlink-2.0.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for osm_shortlink-2.0.0-cp313-cp313-win_amd64.whl
osm_shortlink-2.0.0-cp313-cp313-musllinux_1_2_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-64 Details for osm_shortlink-2.0.0-cp313-cp313-musllinux_1_2_x86_64.whl
osm_shortlink-2.0.0-cp313-cp313-musllinux_1_2_aarch64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ ARM64 Details for osm_shortlink-2.0.0-cp313-cp313-musllinux_1_2_aarch64.whl
osm_shortlink-2.0.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for osm_shortlink-2.0.0-cp313-cp313-manylinux_2_28_x86_64.whl
osm_shortlink-2.0.0-cp313-cp313-manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64 Details for osm_shortlink-2.0.0-cp313-cp313-manylinux_2_28_aarch64.whl
osm_shortlink-2.0.0-cp313-cp313-macosx_11_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 11.0+ x86-64 Details for osm_shortlink-2.0.0-cp313-cp313-macosx_11_0_x86_64.whl
osm_shortlink-2.0.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for osm_shortlink-2.0.0-cp313-cp313-macosx_11_0_arm64.whl
osm_shortlink-2.0.0-cp312-cp312-win_arm64.whl CPython 3.12 CPython 3.12 Windows ARM64 Details for osm_shortlink-2.0.0-cp312-cp312-win_arm64.whl
osm_shortlink-2.0.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for osm_shortlink-2.0.0-cp312-cp312-win_amd64.whl
osm_shortlink-2.0.0-cp312-cp312-musllinux_1_2_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-64 Details for osm_shortlink-2.0.0-cp312-cp312-musllinux_1_2_x86_64.whl
osm_shortlink-2.0.0-cp312-cp312-musllinux_1_2_aarch64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ ARM64 Details for osm_shortlink-2.0.0-cp312-cp312-musllinux_1_2_aarch64.whl
osm_shortlink-2.0.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for osm_shortlink-2.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
osm_shortlink-2.0.0-cp312-cp312-manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ ARM64 Details for osm_shortlink-2.0.0-cp312-cp312-manylinux_2_28_aarch64.whl
osm_shortlink-2.0.0-cp312-cp312-macosx_11_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 11.0+ x86-64 Details for osm_shortlink-2.0.0-cp312-cp312-macosx_11_0_x86_64.whl
osm_shortlink-2.0.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for osm_shortlink-2.0.0-cp312-cp312-macosx_11_0_arm64.whl
osm_shortlink-2.0.0-cp311-cp311-win_arm64.whl CPython 3.11 CPython 3.11 Windows ARM64 Details for osm_shortlink-2.0.0-cp311-cp311-win_arm64.whl
osm_shortlink-2.0.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for osm_shortlink-2.0.0-cp311-cp311-win_amd64.whl
osm_shortlink-2.0.0-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details for osm_shortlink-2.0.0-cp311-cp311-musllinux_1_2_x86_64.whl
osm_shortlink-2.0.0-cp311-cp311-musllinux_1_2_aarch64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ ARM64 Details for osm_shortlink-2.0.0-cp311-cp311-musllinux_1_2_aarch64.whl
osm_shortlink-2.0.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for osm_shortlink-2.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
osm_shortlink-2.0.0-cp311-cp311-manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64 Details for osm_shortlink-2.0.0-cp311-cp311-manylinux_2_28_aarch64.whl
osm_shortlink-2.0.0-cp311-cp311-macosx_11_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 11.0+ x86-64 Details for osm_shortlink-2.0.0-cp311-cp311-macosx_11_0_x86_64.whl
osm_shortlink-2.0.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for osm_shortlink-2.0.0-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 14.2 MB

Security for osm-shortlink 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 65 files in this release have been uploaded with provenance metadata.

Select from 65 files

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page