unity_sds_client.resources package

Submodules

unity_sds_client.resources.collection module

class unity_sds_client.resources.collection.Collection(id)

Bases: object

The Collection object contains metadata about a collection within the Unity system.

add_dataset(dataset: Dataset)
data_files(roles=[])

A method to list all assets (data, metdata, etc) :param type: List of “stac asset roles” to filter on. commonly [“data”] is of most importance :type type: List of Strings

Returns:

List of returned datafiles

Return type:

files

data_locations(roles=[])

A method to list all asset locations (data, metdata, etc) :param type: List of “stac asset roles” to filter on. commonly [“data”] is of most importance :type type: List of Strings

Returns:

List of returned asset locations

Return type:

locations

property datasets

A method to return the included datasets from a collection object.

Returns
dataset

List of dataset objects

from_stac()

A method for reading stac and converting it into a unity collection object. This is usually the result of a stage-in operation. stac formats supported are “GEOJSON Feature Collections” and STAC Catalogs with referenced item files. :param stac_file: The location of the stac file to read. :type stac_file: String

Returns:

A collection object including defined datasets

Return type:

Collection

is_uri()
to_stac(data_dir)

A method for writing stac and converting it from a unity collection object. The caller is responsible for providing a collection, datasets and datafiles along with the output location of the data. :param collection: The colleciton object to convert into stac catalog + stac item files. :type collection: Collection :param stac_file: The location of the stac file to read. :type stac_file: String

unity_sds_client.resources.data_file module

class unity_sds_client.resources.data_file.DataFile(type, location, roles=[], title='', description='')

Bases: object

The Collection object contains metadata about a collection within the Unity system.

unity_sds_client.resources.dataset module

class unity_sds_client.resources.dataset.Dataset(name, collection_id, start_time, end_time, creation_time, properties=None)

Bases: object

The Dataset object contains metadata about a collection within the Unity system, and also is a container for the data_files within a dataset.

A Dataset can be made up of one or more files. A data file is the most common data_file wihtin a dataset. Other examples include metadata, browse imagery, checksums, etc.

add_data_file(datafile: type = <class 'unity_sds_client.resources.data_file.DataFile'>)

adds a data file to a dataset

Parameters:

datafile (DataFile) – a unity_sds_client.resource.datafile object containing the location of data products.

add_property(key, value)

adds a custom metadata property to a dataset

Parameters:
  • key (String) – The property name to be set

  • Value (Object) – the property value to be set

unity_sds_client.resources.job module

class unity_sds_client.resources.job.Job(session: UnitySession, endpoint: str, process_id: str, job_id: int, status: JobStatus | None = None, inputs: object | None = None)

Bases: object

dismiss()
get_result()
get_status()

unity_sds_client.resources.job_status module

class unity_sds_client.resources.job_status.JobStatus(value)

Bases: Enum

The JobServices class is used to specify a job status.

ACCEPTED = 'accepted'
DISMISSED = 'dismissed'
FAILED = 'failed'
RUNNING = 'running'
SUCCESSFUL = 'successful'
from_status()

unity_sds_client.resources.process module

class unity_sds_client.resources.process.Process(session: UnitySession, endpoint: str, process_id: str, title: str, abstract: str, process_version: str, keywords: str, job_control_options: list, inputs: object | None = None, outputs: object | None = None)

Bases: object

execute(data) Job

@param data: @return Job:

unity_sds_client.resources.stac_collection module

class unity_sds_client.resources.stac_collection.STACCollectionCreator(collection_name: str, collection_id: str, output_stac_catalog: str)

Bases: object

A class to create STAC Collection objects from a list of files using PySTAC. Each file becomes a pystac.Item with the file as a pystac.Asset.

create_collection(file_paths: List[str | Path]) Collection

Create a STAC Collection object from a list of files using Unity SDS.

Parameters:

file_paths – List of file paths to include in the collection

Returns:

Collection object

create_collection_to_stac(file_paths: List[str | Path]) Collection

Create a STAC Collection from file paths and save to STAC catalog.

Parameters:

file_paths – List of file paths to include

Returns:

Collection object

Module contents