pydantic-geojson
Pydantic validation for GeoJson
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction (one dependency), and directly solves the problem of validating GeoJSON data in Python. Use it if you need type-safe GeoJSON handling in any application, especially those using Pydantic or FastAPI.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low friction: single dependency on pydantic, pure-Python wheel, actively maintained with recent commits and support for current Python versions (3.9 through 3.14).
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2026-03-01 (166 days) · last repo commit 2026-08-11 · 39 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 84,051 downloads/mo, #14,030 on PyPI
Alternatives
Verify before relying
pip install pydantic_geojson
from pydantic_geojson import PointModel
point = PointModel(
type="Point",
coordinates=[-105.01621, 39.57422]
)
print(point)- Whether coordinate validation (longitude -180 to 180, latitude -90 to 90) is enforced at parse time or only on explicit validation calls.
- Performance characteristics when parsing large FeatureCollections or deeply nested GeometryCollections.
What it is and what it does
pydantic-geojson wraps the GeoJSON specification (RFC 7946) in Pydantic models, letting you parse and validate geographic data with full type safety. It provides model classes for all nine GeoJSON object types: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature, and FeatureCollection. Each model enforces the correct structure and coordinate ranges automatically.
The library integrates directly with Pydantic's validation pipeline, so you can use it in FastAPI endpoints, define custom property schemas for features, and get automatic OpenAPI documentation. It handles both raw GeoJSON dictionaries (via model construction) and nested geometry validation, making it useful for APIs, geospatial data pipelines, and any application that needs to trust incoming geographic data.
Use it for
- Validate incoming GeoJSON in FastAPI endpoints with automatic OpenAPI schema generation.
- Parse and type-check geographic features from external APIs or file uploads.
- Define typed property schemas for GeoJSON features to enforce application-specific metadata.
- Build geospatial REST APIs where coordinate ranges and geometry types must be correct.
- Store and validate geographic data in applications that work with maps or location services.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, installs with minimal friction (one dependency), and directly solves the problem of validating GeoJSON data in Python. Use it if you need type-safe GeoJSON handling in any application, especially those using Pydantic or FastAPI.
Install
pydantic-geojson on PyPI
Before you install
Low friction: single dependency on pydantic, pure-Python wheel, actively maintained with recent commits and support for current Python versions (3.9 through 3.14).
Requires Python 3.9 or later.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install pydantic_geojson
from pydantic_geojson import PointModel
point = PointModel(
type="Point",
coordinates=[-105.01621, 39.57422]
)
print(point)
Verify before relying
- Whether coordinate validation (longitude -180 to 180, latitude -90 to 90) is enforced at parse time or only on explicit validation calls.
- Performance characteristics when parsing large FeatureCollections or deeply nested GeometryCollections.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepydantic |
| Maintenance | Actively maintained 166 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 84,051 / month, #14,030 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Scientific/Engineering :: GIS |
Evidence: pydantic_geojson-0.3.2-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 › “rfc 7946 validation”
- pydantic-geojsonProvides Pydantic-based type-safe validation and models for GeoJSON…
- geojson-pydanticProvides Pydantic models that validate and serialize GeoJSON data…
- fqdnValidates fully-qualified domain names (FQDNs) against RFC 1123…
Give your agent the search over MCP, or paste the wish link into any chat.
More GIS packages
Shapely provides Python tools for creating, manipulating, and analyzing 2D geometric objects (points, lines, polygons) using the GEOS library, with both scalar and vectorized NumPy-based operations.
pyproj provides a Python interface to PROJ, enabling cartographic projections and coordinate system transformations for geospatial applications.
GeoPandas extends pandas DataFrames to handle geographic data, combining pandas operations with shapely geometry and spatial analysis capabilities that would otherwise require a spatial database.
Install it if you work with geographic data in Python and want to avoid setting up a spatial database or learning a separate GIS tool.
geopy is a Python client for geocoding and distance calculation that converts addresses to coordinates and vice versa using multiple web-based geocoding services, and computes geodesic and great-circle distances between geographic points.
Install it if you need geocoding or distance calculations in your application.
Pyogrio provides fast, bulk-oriented read and write access to vector spatial data formats (Shapefile, GeoPackage, GeoJSON, etc.) via GDAL/OGR bindings, typically for use with GeoPandas GeoDataFrames.
h3 provides Python bindings to Uber's H3 geospatial indexing library, converting geographic coordinates into hierarchical hexagonal grid cells and performing spatial operations on them.
See also geojson · geojson-pydantic · sigstore-models · antimeridian · pygeoif · geomet · sigstore-rekor-types · openresponses-types · stac-pydantic · djangorestframework-gis