stac-pydantic
Pydantic data models for the STAC spec
What it is and what it does
stac-pydantic wraps the STAC specification (Spatiotemporal Asset Catalog) in Pydantic models, letting you validate and serialize geospatial metadata as strongly-typed Python objects. It covers core STAC Catalogs, Collections, and Items, plus the STAC API extensions for dynamic catalog queries. The library is built on pydantic, click, geojson-pydantic, and typing-extensions, making it lightweight and suitable for embedding in web services like FastAPI.
The main use case is request/response validation in APIs that serve or consume STAC data. It handles the namespace aliasing that STAC extensions require (e.g., eo:cloud_cover becomes a Python attribute), provides extension validation against remote JSON schemas, and ensures required fields are preserved during export even when null. For comprehensive schema validation and robust extension support, the documentation recommends pystac as an alternative.
Use it for:
- Validate STAC Items and Catalogs in a FastAPI endpoint before storing or forwarding them.
- Serialize Python geospatial metadata objects to STAC-compliant JSON with automatic namespace handling.
- Validate STAC extension fields (e.g., EO, Projection) against their published JSON schemas.
- Build a STAC API server that accepts ItemSearch queries and returns ItemCollections with type safety.
- Parse and validate STAC Catalogs from remote URLs or local files into typed Python objects.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Pydantic models for validating and serializing STAC (Spatiotemporal Asset Catalog) Catalogs, Collections, Items, and STAC API specifications, enabling type-safe request/response handling in web frameworks.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It is the standard choice for type-safe STAC handling in Python web frameworks. Install it if you are building or consuming STAC APIs or need to validate geospatial catalog metadata.
Install
stac-pydantic on PyPI
pip
pip install stac-pydanticuv
uv add stac-pydanticpoetry
poetry add stac-pydanticInstalling stac-pydantic
Before you install
Low friction: pure Python wheel with only four runtime dependencies (click, geojson-pydantic, pydantic, typing-extensions). Actively maintained with a release 49 days ago and no known vulnerabilities.
License in practice
MIT License permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install stac-pydantic
from stac_pydantic import Catalog
stac_catalog = {
"type": "Catalog",
"stac_version": "1.0.0",
"id": "sample",
"description": "Sample catalog",
"links": [{"href": "item.json", "rel": "item"}]
}
catalog = Catalog(**stac_catalog)
print(catalog.id)
Requires Python 3.10 or later.
Verify before relying
- Whether the library's extension validation (validate_extensions) works reliably with custom vendor extensions beyond the official STAC registry.
- Performance characteristics when handling large catalogs with many items or deeply nested structures.
- Whether the CLI validate-item command supports all STAC Item variants and extensions.
Package facts
| License | MIT License Copyright (c) 2020 Arturo AI Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — click, geojson-pydantic, pydantic, typing-extensions |
| Maintenance | actively maintained — 49 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 151,497/month — #10,929 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: stac_pydantic-3.6.0-py3-none-any.whl
Keywords: pydantic, stac, validation
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
geojson-pydanticProvides Pydantic models that validate and…
permissive · top 5,000 on PyPI
stac-fastapi-typesProvides core type definitions and data models…
permissive · top 15,000 on PyPI
stac-fastapi-apiProvides a FastAPI-based implementation of the…
permissive · top 15,000 on PyPI
stac-fastapi-extensionsProvides FastAPI extensions for the STAC API…
permissive · top 15,000 on PyPI
stac-fastapi-pgstacProvides a FastAPI-based HTTP interface to…
permissive · top 15,000 on PyPI
pydantic-collectionsProvides a `BaseCollectionModel` class that…
permissive · top 15,000 on PyPI
pystac-corePySTAC Core provides the foundational API for…
permissive · top 5,000 on PyPI
pystacPySTAC is a Python library for reading,…
permissive · top 5,000 on PyPI
openapi-pydanticProvides Pydantic-based classes that implement…
permissive · top 1,000 on PyPI
pydantic-geojsonProvides Pydantic-based type-safe validation…
permissive · top 15,000 on PyPI