pypolyline
Fast Google Polyline encoding and decoding using Rust FFI
Decision gist · record as of 2026-08-14
Yes, if you work with polyline-encoded geographic data. The package is actively maintained, has no known vulnerabilities, supports current Python versions across major platforms, and delivers substantial performance gains over pure-Python alternatives. The only caveat is verifying that the Blue Oak 1.0.0 license fits your use case, and remembering that coordinates must be in (Longitude, Latitude) order.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Coordinates must be in (Longitude, Latitude) order, not the more common (Latitude, Longitude).
- Precision parameter (5 for Google Polyline, 6 for OSRM/Valhalla) must be specified.
- Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10–3.14 on Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows 64-bit.
License · maintenance · safety
BlueOak-1.0.0 (unclear) — Licensed under Blue Oak Model Licence 1.0.0 (SPDX: BlueOak-1.0.0), a permissive open-source license. License treatment is marked unclear in metadata; verify terms directly in the LICENCE.md file if commercial use or redistribution is planned.
last release 2026-05-19 (87 days) · last repo commit 2026-08-13 · 45 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 105,569 downloads/mo, #12,691 on PyPI
Alternatives
Verify before relying
from pypolyline.cutil import encode_coordinates, decode_polyline
coords = [[52.64125, 23.70162], [52.64938, 23.70154]]
polyline = encode_coordinates(coords, 5)
decoded = decode_polyline(polyline, 5)- Whether Blue Oak 1.0.0 license is compatible with your project's licensing requirements or redistribution model.
- Performance characteristics on your specific hardware and coordinate dataset size relative to the M2 MBP benchmarks cited.
What it is and what it does
Pypolyline is a Python wrapper around a Rust library that encodes and decodes the Google Polyline Algorithm format, which compresses sequences of latitude-longitude coordinates into a compact string representation. It is designed for mapping and geospatial applications where route data, GPS traces, or other coordinate sequences need to be efficiently stored or transmitted.
The package uses FFI (Foreign Function Interface) and Cython to call compiled Rust code, achieving significant speed improvements over pure-Python implementations. It depends only on numpy and provides two main functions: encode_coordinates() to compress coordinate arrays into polyline strings, and decode_polyline() to expand them back. Error handling raises RuntimeError with details on invalid input. The package supports all currently supported Python versions (3.10–3.14) across Linux, macOS, and Windows.
Use it for
- Compress GPS traces or route data for storage in a database or API response.
- Encode map directions or navigation paths for transmission over bandwidth-constrained connections.
- Decode polyline strings from Google Maps API responses or other mapping services.
- Serialize coordinate sequences in web applications to reduce JSON payload size.
- Convert between different polyline precision levels (Google's 5 vs. OSRM/Valhalla's 6).
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with polyline-encoded geographic data.
The package is actively maintained, has no known vulnerabilities, supports current Python versions across major platforms, and delivers substantial performance gains over pure-Python alternatives. The only caveat is verifying that the Blue Oak 1.0.0 license fits your use case, and remembering that coordinates must be in (Longitude, Latitude) order.
Install
pypolyline on PyPI
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10–3.14 on Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows 64-bit. Last release 87 days ago; repository is active with recent commits.
Coordinates must be in (Longitude, Latitude) order, not the more common (Latitude, Longitude). Precision parameter (5 for Google Polyline, 6 for OSRM/Valhalla) must be specified.
License in practice
Licensed under Blue Oak Model Licence 1.0.0 (SPDX: BlueOak-1.0.0), a permissive open-source license. License treatment is marked unclear in metadata; verify terms directly in the LICENCE.md file if commercial use or redistribution is planned.
Quickstart
from pypolyline.cutil import encode_coordinates, decode_polyline
coords = [[52.64125, 23.70162], [52.64938, 23.70154]]
polyline = encode_coordinates(coords, 5)
decoded = decode_polyline(polyline, 5)
Verify before relying
- Whether Blue Oak 1.0.0 license is compatible with your project's licensing requirements or redistribution model.
- Performance characteristics on your specific hardware and coordinate dataset size relative to the M2 MBP benchmarks cited.
Package facts
| License | BlueOak-1.0.0 unclear |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 87 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,569 / month, #12,691 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: GISTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pypolyline-0.5.8-cp310-cp310-macosx_11_0_arm64.whl; pypolyline-0.5.8-cp310-cp310-macosx_11_0_x86_64.whl; pypolyline-0.5.8-cp310-cp310-manylinux_2_28_aarch64.whl; pypolyline-0.5.8-cp310-cp310-manylinux_2_28_x86_64.whl; pypolyline-0.5.8-cp310-cp310-win_amd64.whl; pypolyline-0.5.8-cp311-cp311-macosx_11_0_arm64.whl; pypolyline-0.5.8-cp311-cp311-macosx_11_0_x86_64.whl; pypolyline-0.5.8-cp311-cp311-manylinux_2_28_aarch64.whl; pypolyline-0.5.8-cp311-cp311-manylinux_2_28_x86_64.whl; pypolyline-0.5.8-cp311-cp311-win_amd64.whl; pypolyline-0.5.8-cp312-cp312-macosx_11_0_arm64.whl; pypolyline-0.5.8-cp312-cp312-macosx_11_0_x86_64.whl; pypolyline-0.5.8-cp312-cp312-manylinux_2_28_aarch64.whl; pypolyline-0.5.8-cp312-cp312-manylinux_2_28_x86_64.whl; pypolyline-0.5.8-cp312-cp312-win_amd64.whl; pypolyline-0.5.8-cp313-cp313-macosx_11_0_arm64.whl; pypolyline-0.5.8-cp313-cp313-macosx_11_0_x86_64.whl; pypolyline-0.5.8-cp313-cp313-manylinux_2_28_aarch64.whl; pypolyline-0.5.8-cp313-cp313-manylinux_2_28_x86_64.whl; pypolyline-0.5.8-cp313-cp313-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “route encoding”
- pypolylineEncodes and decodes Google Polyline format coordinates using Rust…
- polylineEncodes and decodes geographic coordinate sequences using Google's…
- flexpolylineEncodes and decodes geographic coordinate sequences into a compressed…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also flexpolyline · polyline · geohash2 · pygeohash · geobuf · pylzss · tzfpy · convertbng · simplification · py-geohex3