Skip to content

Storage

The Storage class enables access to UP42 storage.

storage = up42.initialize_storage()

Assets

get_assets()

The get_assets() function allows you to search for assets in storage.

The returned data type is Union[list[Asset], dict].

Arguments
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:
  • ARCHIVE: assets from catalog orders
  • TASKING: assets from tasking orders
  • PROCESSING: assets resulting from processing
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:
  • id
  • workspaceId
  • accountId
  • createdAt
  • updatedAt
  • name
  • size
  • contentType
  • geospatialMetadataExtractionStatus
  • productId
  • orderId
  • producerName
  • collectionName
  • source
The default value is createdAt.
descending bool
Determines the sorting order of elements.
  • True: arrange elements in descending order based on the field specified in sortby.
  • False: arrange elements in ascending order based on the field specified in sortby.
The default value is True.
return_json bool
Determines how to return assets.
  • True: return JSON.
  • False: return a list of asset objects.
The default value is False.
Example
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,
)

Orders

get_orders()

The get_orders() function allows you to search for tasking and catalog orders.

The returned data type is Union[list[Order], dict].

Arguments
Argument Overview
workspace_orders bool
Determines the scope of orders to return.
  • True: return orders from your workspace.
  • False: return orders from the entire account.
The default value is True.
return_json bool
Determines how to return orders.
  • True: return JSON.
  • False: return a list of order objects.
The default value is 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
  • updatedAt
  • status
  • dataProvider
  • type
The default value is createdAt.
descending bool
Determines the arrangement of elements:
  • True: arrange elements in descending order based on the field specified in sortby.
  • False: arrange elements in ascending order based on the field specified in sortby.
The default value is 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:
  • TASKING: use to get only tasking orders.
  • ARCHIVE: use to get only catalog orders.
statuses list[str]
The status of the order. The allowed values are as follows:
  • CREATED
  • BEING_PLACED
  • PLACED
  • PLACEMENT_FAILED
  • DELIVERY_INITIALIZATION_FAILED
  • BEING_FULFILLED
  • DOWNLOAD_FAILED
  • DOWNLOADED
  • FULFILLED
  • FAILED_PERMANENTLY
name str
The name of the order.
tags list[str]
Order tags. Use to search for orders with any of the provided tags.
Example
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"],
)