API
The section shows information about the API relevant for the developers.
eodm.extract
extract_stac_api_collections(url)
Extracts collections from a STAC API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
Link to STAC API endpoint |
required |
Yields:
Type | Description |
---|---|
Collection
|
Iterator[Collection]: pystac Collections |
Source code in src/eodm/extract.py
extract_stac_api_items(url, collections=None, bbox=None, datetime_interval=None, limit=None)
Extracts items from a STAC API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
Link to STAC API endpoint |
required |
collections |
list[str] | None
|
List of collections to extract items from. Defaults to None. |
None
|
bbox |
tuple[float, float, float, float] | None
|
Bounding box to search. Defaults to None. |
None
|
datetime_interval |
str | None
|
Datetime interval to search. Defaults to None. |
None
|
limit |
int
|
Limit query to given number. Defaults to 10. |
None
|
Yields:
Type | Description |
---|---|
Item
|
Iterator[Item]: pystac Items |
Source code in src/eodm/extract.py
eodm.load
DEFAULT_HEADERS = {'Content-Type': 'application/json'}
module-attribute
load_stac_api_collections(url, collections, headers=None, verify=True, update=False, skip_existing=False)
Load multiple collections to a stac API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
STAC API URL |
required |
collections |
Iterable[Collection]
|
A collection of STAC Collections |
required |
headers |
dict[str, str] | None
|
Additional headers to send. Defaults to None. |
None
|
verify |
bool
|
Verify TLS request. Defaults to True. |
True
|
update |
bool
|
Update the destination Collections. Defaults to False. |
False
|
skip_existing |
bool
|
Skip existing Collections. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
Iterable[Collection]
|
Iterable[Collection]: |
Source code in src/eodm/load.py
load_stac_api_items(url, items, headers=None, verify=True, update=False, skip_existing=False)
Load multiple items into a STAC API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
STAC API url |
required |
items |
Iterable[Item]
|
A collection of STAC Items |
required |
headers |
dict[str, str] | None
|
Headers to add to the request. Defaults to None. |
None
|
verify |
bool
|
Verify SSL request. Defaults to True. |
True
|
update |
bool
|
Update STAC Item with new content. Defaults to False. |
False
|
skip_existing |
bool
|
Skip Item if exists. Defaults to False. |
False
|
Source code in src/eodm/load.py
eodm.serializers
Mappable
Bases: Protocol
to_dict()
Source code in src/eodm/serializers.py
default_serializer(items)
Serializes a list of Mappables (implementing to_dict()) to json strings individually
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items |
Iterable[Mappable]
|
A collection of Mappable items |
required |
Returns:
Type | Description |
---|---|
Iterable[str]
|
Iterable[str]: item as a string |
Yields:
Type | Description |
---|---|
Iterable[str]
|
Iterator[Iterable[str]]: Collection of json strings |
Source code in src/eodm/serializers.py
json_serializer(items)
Serializes a list of Mappables (implementing to_dict()) to a json list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items |
Iterable[Mappable]
|
A collection of Mappable items |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
items as a json list |
Source code in src/eodm/serializers.py
eodm.stac_contrib
__all__ = ['FSSpecStacIO']
module-attribute
FSSpecStacIO
Bases: StacIO
Extension of StacIO to allow working with different filesystems in STAC using fsspec.
More information: https://pystac.readthedocs.io/en/stable/concepts.html#i-o-in-pystac