This API reference is auto-generated from the Python docstrings. The table of contents on the left is organized by module. The sections below are organized based on concepts and sections within the STAC Spec and PySTAC itself.
Base Structures & Classes#
These are the core Python classes representing entities within the STAC Spec. These classes provide convenient methods for serializing and deserializing from JSON, extracting properties, and creating relationships between entities.
These are representations of Collections and related structures.
pystac.ItemCollection: Represents a GeoJSON FeatureCollection in which all Features are STAC Items.
Representations of Catalogs and related structures.
These classes are used to read and write files from disk or over the network, as well as to serialize and deserialize STAC object to and from JSON.
PySTAC provides support for the following STAC Extensions:
The following classes are used internally to implement these extensions and may be used to create custom implementations of STAC Extensions not supported by the library (see Adding New and Custom Extensions for details):
pystac.extensions.base.ExtensionManagementMixin: Abstract base class with methods for adding and removing extensions from STAC Objects.
pystac.extensions.hooks.ExtensionHooks: Used to implement hooks when extending a STAC Object. Primarily used to implement migrations from one extension version to another.
These classes are used to set the HREFs of a STAC according to some layout. The templating functionality is also used when generating subcatalogs based on a template.
pystac.layout.LayoutTemplate: Represents a template that can be used for deriving paths or other information based on properties of STAC objects supplied as a template string.
pystac.layout.CustomLayoutStrategy: Layout strategy that allows users to supply functions to dictate stac object paths.
The following exceptions may be raised internally by the library.
pystac.STACError: Generic STAC-related error
pystac.STACTypeError: Raised when a representation of a STAC entity is encountered that is not correct for the context
pystac.DuplicateObjectKeyError: Raised when deserializing a JSON object containing a duplicate key.
pystac.ExtensionAlreadyExistsError: Raised when deserializing a JSON object containing a duplicate key.
pystac.ExtensionTypeError: Raised when an extension is used against an object to which that the extension does not apply to.
pystac.ExtensionNotImplemented: Raised on an attempt to extend a STAC object that does not implement the given extension.
pystac.RequiredPropertyMissing: Raised when a required value is expected to be present but is missing or
pystac.STACValidationError: Raised by validation calls if the STAC JSON is invalid.
pystac.TemplateError: Raised when an error occurs while converting a template string into data for
pystac.serialization sub-package contains tools used internally by PySTAC to
identify, serialize, and migrate STAC objects:
pystac.serialization.identify: Tools for identifying STAC objects
pystac.serialization.migrate: Tools for migrating STAC objects from a previous STAC Spec version.
The tools described here require that you install PySTAC with the
extra (see the documentation on installing dependencies for details).
PySTAC includes a
pystac.validation package for validating STAC objects, including
from PySTAC objects and directly from JSON.
pystac.validation.stac_validator.STACValidator: Abstract base class defining methods for validating STAC JSON. Implementations define methods for validating core objects and extension.
pystac.validation.stac_validator.JsonSchemaSTACValidator: The default
STACValidatorimplementation used by PySTAC. Uses JSON schemas read from URIs provided by a
SchemaUriMap, to validate STAC objects.
pystac.validation.schema_uri_map.SchemaUriMap: Defines methods for mapping STAC versions, object types and extension ids to schema URIs. A default implementation is included that uses known locations; however users can provide their own schema URI maps in a
JsonSchemaSTACValidatorto modify the URIs used.
pystac.validation.schema_uri_map.DefaultSchemaUriMap: The default
SchemaUriMapused by PySTAC.
These classes are used internally by PySTAC for caching.