geojson
Python bindings and utilities for GeoJSON
What it is and what it does
geojson is a Python library for working with GeoJSON, the standard text-based format for encoding geographic data structures. It provides classes representing all GeoJSON object types—Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature, and FeatureCollection—along with encoding and decoding functions. Each class implements the __geo_interface__ specification, allowing objects to be used as attributes or indexed directly when nested in collections.
The library is designed for developers and researchers working with geographic information systems (GIS) data. It handles the conversion between Python objects and GeoJSON-formatted JSON, making it straightforward to construct geographic features programmatically, serialize them for storage or transmission, and parse incoming GeoJSON data. With no external dependencies and support for modern Python versions, it integrates easily into geospatial workflows.
Use it for:
- Build geographic features (points, lines, polygons) and wrap them in Feature objects with properties for mapping applications.
- Parse and validate incoming GeoJSON data from APIs or files into typed Python objects for further processing.
- Serialize geographic data to GeoJSON format for storage in databases or transmission over HTTP to web mapping clients.
- Construct FeatureCollections containing multiple geographic features with associated metadata for batch geospatial operations.
- Implement __geo_interface__ on custom objects to make them compatible with GeoJSON serialization workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes, decodes, and represents GeoJSON formatted geographic data through Python classes for all GeoJSON object types and implements the __geo_interface__ specification.
Yes. geojson is a stable, actively maintained library with zero dependencies, permissive licensing, and no known vulnerabilities. It directly implements the GeoJSON specification and is well-suited for any Python project handling geographic data. Install it if you need to work with GeoJSON in a Python application.
Install
geojson on PyPI
pip
pip install geojsonuv
uv add geojsonpoetry
poetry add geojsonInstalling geojson
Before you install
Low friction install with no runtime dependencies. Actively maintained with recent releases; repository shows 994 stars and current Python version support (3.10–3.14).
License in practice
BSD permissive license allows use in most projects without significant restrictions on modification or distribution.
Quickstart
pip install geojson
from geojson import Point, Feature, FeatureCollection
point = Point((-115.81, 37.24))
feature = Feature(geometry=point, properties={"name": "example"})
collection = FeatureCollection([feature])
Requires Python 3.10 or later.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 78 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,395,724/month — #2,313 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: geojson-3.3.0-py3-none-any.whl
Keywords: gis, geography, json
Tags
More GIS packages
Shapely provides Python tools for creating,…
permissive · top 1,000 on PyPI
pyprojpyproj provides a Python interface to PROJ,…
permissive · top 1,000 on PyPI
geopandasGeoPandas extends pandas DataFrames to handle…
permissive · top 1,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
pyogrioPyogrio provides fast, bulk-oriented read and…
permissive · top 5,000 on PyPI
h3h3 provides Python bindings to Uber's H3…
permissive · top 5,000 on PyPI
arcgis2geojsonConverts ArcGIS JSON format to GeoJSON format,…
permissive · top 15,000 on PyPI
cligjProvides reusable Click command-line argument…
permissive · top 5,000 on PyPI
djangorestframework-gisAdds geographic and GeoJSON support to Django…
permissive · top 15,000 on PyPI
pydantic-geojsonProvides Pydantic-based type-safe validation…
permissive · top 15,000 on PyPI
pygeoifPyGeoIf provides lightweight, pure-Python…
copyleft · top 15,000 on PyPI
kml2geojsonConverts KML files to GeoJSON format,…
permissive · top 15,000 on PyPI
osm2geojsonConverts OpenStreetMap and Overpass API data…
permissive · top 15,000 on PyPI
geometConverts between GeoJSON, WKT/WKB, Extended…
permissive · top 5,000 on PyPI
topojsontopojson encodes spatial data into TopoJSON…
permissive · top 15,000 on PyPI
plpygisConverts geometries between WKB/EWKB, WKT/EWKT,…
copyleft · top 15,000 on PyPI