OpenStreetMap shortlink encoder and decoder
Project description
osm-shortlink
Fast and correct OpenStreetMap shortlink encoder and decoder implementation in Rust with Python bindings. Shortlinks allow you to represent a location on the map with a short code.
Installation
The recommended installation method is through the PyPI package manager. The project is implemented in Rust, offering excellent performance characteristics. Several pre-built binary wheels are available for Linux, macOS, and Windows, with support for both x64 and ARM architectures.
pip install osm-shortlink
Basic usage
from osm_shortlink import shortlink_encode
shortlink_encode(0.054, 51.510, 9) # -> '0EEQhq--'
shortlink_encode(19.579, 51.876, 19) # -> '0OP4tR~rx'
shortlink_encode(0, 0, 23) # ValueError: Invalid zoom: must be between 0 and 22, got 23
from osm_shortlink import shortlink_decode
shortlink_decode('0EEQhq--') # -> (0.054, 51.510, 9)
shortlink_decode('0OP4tR~rx') # -> (19.579, 51.876, 19)
shortlink_decode('X') # ValueError: Invalid shortlink: too short
Format specification
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
Built Distributions
File details
Details for the file osm_shortlink-1.1.0.tar.gz
.
File metadata
- Download URL: osm_shortlink-1.1.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45e344909dc7aaca1b26c620d19e432fcbbfa896cf7e746789dfa28a70f699a5 |
|
MD5 | 61117732fc74ffd1ffb097e590f4dd0c |
|
BLAKE2b-256 | 0ee489d19290099449b978d4fc15ac08950fad0ff72c641230d4e4f9bb588c5e |
File details
Details for the file osm_shortlink-1.1.0-cp39-abi3-win_amd64.whl
.
File metadata
- Download URL: osm_shortlink-1.1.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 118.6 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47c0bf4d3f7ce914ab3bc61dd046bfa9fdc206fab10614f7055a138ef2bfa1f0 |
|
MD5 | 35c765ec57570f7451158894397d668a |
|
BLAKE2b-256 | 532421c63b247bf6fb9a3dc2f5635fc45aeb6c5e04c1151fd05f70d9b76a9931 |
File details
Details for the file osm_shortlink-1.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: osm_shortlink-1.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 415.9 kB
- Tags: CPython 3.9+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9ba105f7f9ecb2816020c5b10555b75a9f5480aa49a9730e412c6f0a85c5edb |
|
MD5 | 1094d82ff89b0279a5f2d67c864299f2 |
|
BLAKE2b-256 | 61a358a395043a6db36cd48aa949a3b663d80556465a84f97df3c30a1b8267ab |
File details
Details for the file osm_shortlink-1.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
.
File metadata
- Download URL: osm_shortlink-1.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 433.8 kB
- Tags: CPython 3.9+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 138aa7066ba18e9a0559a74ab416aad93051e9a7dee576d84e66ae27f6bcaac8 |
|
MD5 | dd241358ce129f966f2a4b5f397d6ad1 |
|
BLAKE2b-256 | cf20cd8622a1a9fc5895fd0d89e531abcef71a5d4486d58d0d99546ee26498c6 |
File details
Details for the file osm_shortlink-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: osm_shortlink-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 232.2 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e53e9481e08a80827ce26e171b4976b4ecc23904a36032d88a56cfcb78b6eca3 |
|
MD5 | 2e5001e65be40b62de6f5d96fbe30752 |
|
BLAKE2b-256 | 6fc8e5fe34a2b14cbceaa2110f440cf9f135df0a2ec681c33834e0cad7b591fc |
File details
Details for the file osm_shortlink-1.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: osm_shortlink-1.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 223.3 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51e9736ff6dcbbc0b1633db7c07994ce6dcce79916569a4f8f329a22676f4a62 |
|
MD5 | 8b53a5fa4f81770cb5fc4cf9f474dd62 |
|
BLAKE2b-256 | d91fa400635478bcd5fb6ba30dc1719f39425658ca089fb3f50f7b4bfe367c2c |
File details
Details for the file osm_shortlink-1.1.0-cp39-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: osm_shortlink-1.1.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 216.4 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebd652d7aa946879b323f7cd34fb9b7917119efae73148de88c5931a1b81bee0 |
|
MD5 | 0fdc09469c1436a96350ed5e7a32c6a7 |
|
BLAKE2b-256 | 065c31cdebd839bf3518d27da5a84749a03b64512c84821cf63299875328aa73 |
File details
Details for the file osm_shortlink-1.1.0-cp39-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: osm_shortlink-1.1.0-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 218.9 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e91460c41f98ea24a55b5978125e237c02b409ac7ef4f415e7957cf4e6a69c2 |
|
MD5 | ce991a944286bfd84a539fd5f394ff98 |
|
BLAKE2b-256 | 0d1684ff9e4d8cf3f3cbf2e3a9d3a47129f6930f0c271685d9381c52f47ab85f |