--- id: stac-pydantic version: "3.6.0" 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) license_treatment: permissive maintenance: active --- # stac-pydantic — Pydantic data models for the STAC spec License: permissive · Maintenance: active · Downloads: 151.5K/mo ## 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 above — 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 pip install stac-pydantic uv add stac-pydantic poetry add stac-pydantic ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 151.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pydantic models stac catalog, stac validation python, spatiotemporal asset catalog pydantic, stac api schema validation, stac item collection models, geospatial metadata validation, fastapi stac models, geospatial, stac, validation [View on SkillFed](https://skillfed.io/packages/stac-pydantic) · [View on PyPI](https://pypi.org/project/stac-pydantic/)