geojson-pydantic
Pydantic data models for the GeoJSON spec.
What it is and what it does
geojson-pydantic wraps the GeoJSON specification (RFC 7946) as a set of Pydantic models, letting you validate, parse, and serialize geographic data structures with type safety. It depends only on pydantic and works with Python 3.9 through 3.14, making it straightforward to integrate into data pipelines that need to handle GeoJSON.
The package is actively maintained, supports current Python versions, and has no known vulnerabilities. It's used for creating or validating GeoJSON objects—Points, LineStrings, Polygons, Features, and FeatureCollections—ensuring data conforms to the RFC 7946 standard before processing or storage.
Use it for:
- Validate incoming GeoJSON from APIs or files before storing in a geospatial database.
- Build type-safe geographic data structures in Python applications using Pydantic's validation framework.
- Serialize Python geographic objects to RFC 7946-compliant GeoJSON for REST APIs or client applications.
- Parse and transform GeoJSON from external sources with automatic type checking and error reporting.
- Integrate geospatial data validation into FastAPI or other Pydantic-based web services.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Pydantic models that validate and serialize GeoJSON data according to RFC 7946 specification.
Yes. The package has low install friction, active maintenance, permissive MIT licensing, no security vulnerabilities, and fills a clear need for GeoJSON validation in Python. It's a straightforward choice if you're working with geographic data and want Pydantic's validation guarantees.
Install
geojson-pydantic on PyPI
pip
pip install geojson-pydanticuv
uv add geojson-pydanticpoetry
poetry add geojson-pydanticInstalling geojson-pydantic
Before you install
Low friction install with a single runtime dependency on pydantic. Repository is active with a recent commit on 2026-07-24 and no archived status.
License in practice
MIT License permits commercial and private use with minimal restrictions; you may use, modify, and distribute the software freely provided you include the license notice.
Quickstart
pip install geojson-pydantic
from geojson_pydantic import Point
point = Point(coordinates=[1.0, 2.0])
print(point.model_dump_json())
Package facts
| License | MIT License Copyright (c) 2020 Development Seed Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pydantic |
| Maintenance | actively maintained — 129 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,121,112/month — #4,335 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: geojson_pydantic-2.1.1-py3-none-any.whl
Keywords: Pydantic, geojson
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
stac-pydanticProvides Pydantic models for validating and…
permissive · top 15,000 on PyPI
pydantic-geojsonProvides Pydantic-based type-safe validation…
permissive · top 15,000 on PyPI
geojsonEncodes, decodes, and represents GeoJSON…
permissive · top 5,000 on PyPI
scim2-modelsProvides Pydantic models for SCIM2 (System for…
permissive · top 15,000 on PyPI
geobufGeobuf encodes GeoJSON to a compact binary…
permissive · top 15,000 on PyPI
antimeridianFixes Shapely geometries and GeoJSON features…
permissive · top 15,000 on PyPI
djangorestframework-gisAdds geographic and GeoJSON support to Django…
permissive · top 15,000 on PyPI
topojsontopojson encodes spatial data into TopoJSON…
permissive · top 15,000 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
pydantic-xmlPydantic-xml adds XML serialization and…
permissive · top 5,000 on PyPI