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.
pystac.Link: Represents a Link Object.
pystac.MediaType: Provides common values used in the Link and Asset
pystac.RelType: Provides common values used in the Link
pystac.STACObject: Base class implementing functionality common to
Representations of Items and related structures like Asset Objects.
pystac.Asset: Represents an Asset Object
pystac.Item: Represents an Item
pystac.CommonMetadata: A container for fields defined in the Common Metadata section of the spec. These fields are commonly found in STAC Item properties, but may be found elsewhere.
These are representations of Collections and related structures.
pystac.Collection: Represents a Collection.
pystac.Extent: Represents an Extent Object, which is composed of
pystac.Provider: Represents a Provider Object. The
pystac.ProviderRoleenum provides common values used in the
pystac.Summaries: Class for working with various types of CollectionSummaries
pystac.ItemCollection: Represents a GeoJSON FeatureCollection in which all Features are STAC Items.
Representations of Catalogs and related structures.
pystac.Catalog: Represents a Catalog.
pystac.CatalogType: Enum representing the common types of Catalogs described in the STAC Best Practices
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.StacIO: Base class that can be inherited to provide custom I/O
pystac.stac_io.DefaultStacIO: The default
pystac.StacIOimplementation used throughout the library.
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.SummariesExtension: Base class for extending the properties in
pystac.Collection.summariesto include properties defined by a STAC Extension.
pystac.extensions.base.PropertiesExtension: Abstract base class for extending the properties of an
Itemto include properties defined by a STAC Extension.
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.
pystac.extensions.hooks.RegisteredExtensionHooks: Used to register hooks defined in
ExtensionHooksinstances to ensure they are used in object deserialization.
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.BestPracticesLayoutStrategy: Layout strategy that represents the catalog layout described in the STAC Best Practices documentation.
pystac.layout.TemplateLayoutStrategy: Layout strategy that can take strings to be supplied to a
LayoutTemplateto derive paths.
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.