skillfed

geojson-pydantic

Pydantic data models for the GeoJSON spec.

geojson-pydantic v2.1.1 1.1M downloads/30d#4,335 on PyPI284
Permissive 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) Active released

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-pydantic

uv

uv add geojson-pydantic

poetry

poetry add geojson-pydantic

Installing 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

Intended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: GISTyping :: Typed

Tags

geojson validation pydanticgeojson models pythonrfc7946 geojsongeographic data validationgeojson serializationspatial data pydantic modelsgeojson type checking
geospatialdata-validationgeojson

More GIS packages