General
pystac.get_stac_version
get_stac_version() -> str
DEPRECATED Returns the default STAC version.
Warning
This function is deprecated as of PySTAC v2.0 and will be removed in a future version. Just look at DEFAULT_STAC_VERSION.
Returns:
Type | Description |
---|---|
str
|
The default STAC version. |
Examples:
>>> pystac.get_stac_version()
"1.1.0"
Source code in src/pystac/functions.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
pystac.set_stac_version
set_stac_version(version: str) -> None
DEPRECATED This function is a no-op and will be removed in a future version
Warning
In pre-v2.0 PySTAC, this function was used to set the global STAC version.
In PySTAC v2.0 this global capability has been removed — the user should
use Container.set_stac_version()
to mutate an entire catalog.
Source code in src/pystac/functions.py
27 28 29 30 31 32 33 34 35 36 37 38 |
|
pystac.read_file
read_file(
href: str | Path,
stac_io: Any = None,
*,
reader: Read | None = None,
) -> STACObject
Reads a file from a href.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
href
|
str | Path
|
The href to read |
required |
reader
|
Read | None
|
The [Read][pystac.Read] to use for reading |
None
|
Returns:
Type | Description |
---|---|
STACObject
|
The STAC object |
Source code in src/pystac/io.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
pystac.read_dict
read_dict(d: dict[str, Any]) -> STACObject
DEPRECATED Reads a STAC object from a dictionary.
Warning
This function is deprecated as of PySTAC v2.0 and will be removed in a future version. Use STACObject.from_dict instead.
Source code in src/pystac/functions.py
41 42 43 44 45 46 47 48 49 |
|
pystac.write_file
write_file(
obj: STACObject,
include_self_link: bool | None = None,
dest_href: str | Path | None = None,
stac_io: Any = None,
*,
writer: Write | None = None,
) -> None
Writes a STAC object to a file, using its href.
If the href is not set, this will throw and error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
STACObject
|
The STAC object to write |
required |
dest_href
|
str | Path | None
|
The href to write the STAC object to |
None
|
writer
|
Write | None
|
The [Write][pystac.Write] to use for writing |
None
|
Source code in src/pystac/io.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
pystac.PySTACError
Bases: Exception
A custom error class for this library.
Source code in src/pystac/errors.py
1 2 |
|
pystac.STACError
Bases: PySTACError
A subclass of PySTACError for errors related to the STAC specification itself.
Source code in src/pystac/errors.py
5 6 7 |
|
pystac.PySTACWarning
Bases: Warning
A custom warning class for this library.
Source code in src/pystac/errors.py
10 11 |
|
pystac.STACWarning
Bases: PySTACWarning
A warning about something incorrect per the STAC specification.
Source code in src/pystac/errors.py
14 15 |
|