topojson
topojson - a powerful library to encode geographic data as topology in Python!🌍
Decision gist · record as of 2026-08-14
Yes, if you work with geographic data and need file compression. The library is stable (BSD licensed, no known vulnerabilities), has low install friction, and solves a real problem in geospatial workflows. The aging maintenance status (388 days since last release) is a minor concern for new features but not a blocker for core functionality. Install if you're already using shapely and need TopoJSON output; skip if you don't work with spatial data.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later; numpy and shapely must be installed and functional.
- Low friction: pure Python wheel with three straightforward runtime dependencies (numpy, shapely, packaging).
- Last commit 2025-07-22 with 198 repository stars; maintenance status is aging (388 days since last release), so expect slower response to new issues.
License · maintenance · safety
permissive license (permissive) — BSD permissive license allows commercial and private use with minimal restrictions, making it safe for most projects.
last release 2025-07-22 (388 days) · last repo commit 2025-07-22 · 198 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 177,203 downloads/mo, #10,221 on PyPI
Alternatives
Verify before relying
pip install topojson
import topojson
from shapely.geometry import Polygon
polygon = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
topo = topojson.Topology(polygon)- Actual compression ratios and typical file size reductions for real-world datasets
- Performance characteristics and scalability limits for large spatial datasets
- Compatibility with specific GeoJSON or shapely versions beyond the stated dependencies
What it is and what it does
topojson is a Python library that converts spatial objects (geometries from shapely, GeoJSON, or GeoDataFrames) into TopoJSON format, a topology-aware encoding that dramatically reduces file size. It works by computing shared topology between features, encoding coordinates as fixed-precision integers, and optionally simplifying arcs using either Ramer–Douglas–Peucker or Visvalingam-Whyatt algorithms. The library depends on numpy for numerical operations, shapely for geometry handling, and packaging for version management.
You would use topojson when you need to compress geographic data for transmission, storage, or web visualization—particularly when serving maps or spatial datasets over the network where bandwidth matters. It maintains topological relationships during simplification, so adjacent polygons remain properly aligned after reduction. The library is designed for developers working with geographic information systems, web mapping, or data visualization pipelines.
Use it for
- Reduce GeoJSON file sizes for web map applications before serving to browsers
- Compress spatial datasets for storage or archival while preserving topology
- Simplify polygon boundaries in geographic data while keeping adjacent regions aligned
- Convert shapely geometries to a compact format for data interchange or APIs
- Prepare geographic data for interactive visualization with tools like Altair
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with geographic data and need file compression.
The library is stable (BSD licensed, no known vulnerabilities), has low install friction, and solves a real problem in geospatial workflows. The aging maintenance status (388 days since last release) is a minor concern for new features but not a blocker for core functionality. Install if you're already using shapely and need TopoJSON output; skip if you don't work with spatial data.
Install
topojson on PyPI
Before you install
Low friction: pure Python wheel with three straightforward runtime dependencies (numpy, shapely, packaging). Last commit 2025-07-22 with 198 repository stars; maintenance status is aging (388 days since last release), so expect slower response to new issues.
Requires Python 3.8 or later; numpy and shapely must be installed and functional.
License in practice
BSD permissive license allows commercial and private use with minimal restrictions, making it safe for most projects.
Quickstart
pip install topojson
import topojson
from shapely.geometry import Polygon
polygon = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
topo = topojson.Topology(polygon)
Verify before relying
- Actual compression ratios and typical file size reductions for real-world datasets
- Performance characteristics and scalability limits for large spatial datasets
- Compatibility with specific GeoJSON or shapely versions beyond the stated dependencies
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesnumpyshapelypackaging |
| Maintenance | Aging 388 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 177,203 / month, #10,221 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: BSD License |
Evidence: topojson-1.10-py3-none-any.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 › “topojson encoding python”
- topojsontopojson encodes spatial data into TopoJSON format, a compressed…
- highcharts-mapsHighcharts Maps for Python wraps the Highcharts Maps JavaScript…
- webencodingsImplements the WHATWG Encoding standard to map legacy web character…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also polyline · osm2geojson · geobuf · geojson · geopandas · overturemaps · reproj · python-geohash · simplification · rdp