The Storage class enables access to UP42 storage.
Python
storage = up42.initialize_storage()
The get_assets()
function allows you to search for assets in storage. The returned data type is Union[list[Asset], dict]
.
Argument | Overview |
---|---|
created_after | Union[str, datetime] A time condition for search. Use to search for assets created after the timestamp specified in the YYYY-MM-DD format. |
created_before | Union[str, datetime] A time condition for search. Use to search for assets created before the timestamp specified in the YYYY-MM-DD format. |
workspace_id | str The workspace ID. Use to get assets from a specific workspace. Otherwise, assets from the entire account will be returned. |
collection_names | list[str] The names of geospatial collections. Use to search for assets from any of the provided collections. |
producer_names | list[str] The names of producers. Use to search for assets from any of the provided producers. |
tags | list[str] Asset tags. Use to search for assets with any of the provided tags. |
sources | list[str] Asset sources. Use to search for assets from any of the provided sources. The allowed values are as follows:
|
search | str Additional search terms. Use to search for assets that contain the provided search query in their name, title, or ID. |
limit | int The number of assets on a result page. |
sortby | str Arranges elements in the order specified in descending based on a chosen field. The allowed values are as follows:
createdAt . |
descending | bool Determines the sorting order of elements.
True . |
return_json | bool Determines how to return assets.
False . |
An example with get_assets()
Python
storage.get_assets(
created_after="2021-01-01",
created_before="2023-01-01",
workspace_id="68567134-27ad-7bd7-4b65-d61adb11fc78",
collection_names=["phr"],
producer_names=["airbus"],
tags=["optical", "us"],
sources=["ARCHIVE"],
search="NY Central Park",
limit=5,
sortby="productId",
descending=False,
return_json=True,
)
The get_orders()
function allows you to search for tasking and catalog orders. The returned data type is Union[list[Order], dict]
.
Argument | Overview |
---|---|
workspace_orders | bool Determines the scope of orders to return.
True . |
return_json | bool Determines how to return orders.
False . |
limit | int The number of orders on a result page. |
sortby | str Arranges elements in the order specified in descending based on a chosen field. The allowed values are as follows:
createdAt . |
descending | bool Determines the arrangement of elements:
True . |
order_type | str The type of orders to return. To get orders of all types, omit the parameter. The allowed values are as follows:
|
statuses | list[str] The status of the order. The allowed values are as follows:
|
name | str The name of the order. |
tags | list[str] Order tags. Use to search for orders with any of the provided tags. |
An example with get_orders()
Python
storage.get_orders(
workspace_orders=False,
return_json=True,
limit=2,
sortby="status",
descending=False,
order_type="ARCHIVE",
statuses=["FULFILLED"],
name="Spot 6/7 Central Park",
tags=["optical","us"],
)