- class pystac.version.STACVersion
- DEFAULT_STAC_VERSION = '1.0.0'
Latest STAC version supported by PySTAC
- OVERRIDE_VERSION_ENV_VAR = 'PYSTAC_STAC_VERSION_OVERRIDE'
- classmethod get_stac_version() str
- pystac.version.get_stac_version() str
Returns the STAC version PySTAC writes as the “stac_version” property for any object it serializes into JSON.
If a call to
set_stac_versionwas made, this will return the value it was called with. Next it will check the environment for a PYSTAC_STAC_VERSION_OVERRIDE variable. Otherwise it will return the latest STAC version that this version of PySTAC supports.
The STAC Version PySTAC is set up to use.
- Return type:
- pystac.version.set_stac_version(stac_version: str | None) None
Sets the STAC version that PySTAC should use.
This is the version that will be set as the “stac_version” property on any JSON STAC objects written by PySTAC. If set to None, the override version will be cleared if previously set and the default or an override taken from the environment will be used.
You can also set the environment variable PYSTAC_STAC_VERSION_OVERRIDE to override the version.
stac_version – The STAC version to use instead of the latest STAC version that PySTAC supports (described in STACVersion.DEFAULT_STAC_VERSION). If None, clear to use the default for this version of PySTAC.
Setting the STAC version to something besides the default version will not effect the format of STAC read or written; it will only override the
stac_versionproperty of the objects being written. Setting this incorrectly can produce invalid STAC.