Storage class

Access your storage.


Overview

The Storage class enables access to UP42 storage.

Python

    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].

ArgumentOverview
created_afterUnion[str, datetime]
A time condition for search. Use to search for assets created after the timestamp specified in the YYYY-MM-DD format.
created_beforeUnion[str, datetime]
A time condition for search. Use to search for assets created before the timestamp specified in the YYYY-MM-DD format.
workspace_idstr
The workspace ID. Use to get assets from a specific workspace. Otherwise, assets from the entire account will be returned.
collection_nameslist[str]
The names of geospatial collections. Use to search for assets from any of the provided collections.
producer_nameslist[str]
The names of producers. Use to search for assets from any of the provided producers.
tagslist[str]
Asset tags. Use to search for assets with any of the provided tags.
sourceslist[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
searchstr
Additional search terms. Use to search for assets that contain the provided search query in their name, title, or ID.
limitint
The number of assets on a result page.
sortbystr
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.
descendingbool
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_jsonbool
Determines how to return assets.
  • True: return JSON.
  • False: return a list of asset objects.
The default value is 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,
)

  

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].

ArgumentOverview
workspace_ordersbool
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_jsonbool
Determines how to return orders.
  • True: return JSON.
  • False: return a list of order objects.
The default value is False.
limitint
The number of orders on a result page.
sortbystr
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.
descendingbool
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_typestr
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.
statuseslist[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
namestr
The name of the order.
tagslist[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"],
)

  

A button link with the "View repository" text on it