Registry / serialization / pypolyline

pypolyline

JSON →
library0.5.8pypypiunverified

pypolyline provides fast Google Polyline encoding and decoding functionalities, leveraging Rust FFI for performance. It is currently at version 0.5.6 and maintains an active, albeit irregular, release cadence with minor updates addressing improvements and bug fixes.

pip install pypolyline
INSTALL
IMPORT
SIG · PYPOLYLINE
P
pypolyline
serializationpythonv0.5.8
Install
3.8s avg
Import
Disk
88MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.8s · import 0.000s · 86MB
88MB installed
● package 88MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

decode
from pypolyline import decode
from pypolyline import decode
encode
from pypolyline import encode
from pypolyline import encode

This quickstart demonstrates how to encode a list of (latitude, longitude) tuples into a Google Polyline string and decode a Polyline string back into a list of points. The `precision` parameter is crucial for correct encoding/decoding, with `5` being standard for Google Polylines.

from pypolyline.codec import decode, encode # Example data test_polyline = "y~z_@mfhV~tqNvxq`@" test_points = [(38.5, -120.2), (40.7, -120.95), (43.252, -126.453)] # Encoding points to a polyline string (Google Polyline typically uses precision=5) encoded_polyline = encode(test_points, precision=5) print(f"Encoded Polyline: {encoded_polyline}") # Decoding a polyline string back to points decoded_points = decode(test_polyline, precision=5) print(f"Decoded Points: {decoded_points}")
Debug
Known issues
breakingThe `factor` argument for `encode` and `decode` functions was replaced by `precision` in `v0.5.0`. Using `factor` will now raise a TypeError.
fix
Replace `factor=1e5` (or similar) with `precision=5` (or the corresponding precision) in your calls to `encode` and `decode`.
affects: >=0.5.0
gotchaInstallation via `pip` requires a Rust toolchain if a pre-built wheel is not available for your specific Python version and operating system combination.
fix
Ensure you have a Rust toolchain installed (e.g., using `rustup`) if `pip install pypolyline` fails with compiler-related errors. Alternatively, try to use a Python version/OS for which wheels are pre-built (Linux, macOS, Windows are generally well-supported).
affects: All versions
gotchaUsing an incorrect `precision` value will lead to inaccurate decoded points or unnecessarily long (overly precise) encoded polylines.
fix
For standard Google Polylines, always use `precision=5`. If working with custom polyline specifications, ensure the `precision` matches the expected decimal places of the coordinate components.
affects: All versions
Upgrade
Version history
0.5.8latest on PyPI · released May 19, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
pypolyline — pip install pypolyline · libregistry