Processing templates in SDK

View processes to run using the SDK.

Overview

Run advanced processing on tasking and catalog data in your storage.

View repository

Class: JobTemplate

A class for job templates that define the process ID and input validation logic.

Attributes

AttributeDescription
process_id

ClassVar[str]

The process ID in a name format.

workspace_id

Union[str, base.WorkspaceId]

The workspace ID.

errors

set[ValidationError]

A list of errors populated if the job isn’t valid.

Properties

is_valid

Checks if the job is valid. Returns bool:

  • True: The job is valid.
  • False: The job isn’t valid.

Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
stac_client = up42.stac_client()
stac_item = next(stac_client.get_items(stac_item_id))
# Instanitate a TrueColorConversion template
job_template = processing_templates.TrueColorConversion(
title="Imagery over UK",
item=stac_item,
)
# Assert that the job is valid, print errors if not
if not job_template.is_valid:
for error in job_template.errors:
print(f"{error}\n")

Methods

execute

Executes the job. Returns Job.

ParameterDescription
Python
from up42 import processing_templates
# Select an item
14 collapsed lines
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
stac_client = up42.stac_client()
stac_item = next(stac_client.get_items(stac_item_id))
# Instanitate a TrueColorConversion template
job_template = processing_templates.TrueColorConversion(
title="Imagery over UK",
item=stac_item,
)
# Select a budget
budget_id = "a0d443a2-41e8-4995-8b54-a5cc4c448227"
# Execute the templated job
job = job_template.execute(budget_id=budget_id)
# Define output
print(f"Job details for ID: {job.id}")
print(f"Process ID: {job.process_id}")
print(f"Status: {job.status.value}")
print(f"Price: {job.credits or 'N/A'} credits")
print(f"Created at: {job.created}")

Class: SingleItemJobTemplate

A data class for the process templates that require one STAC item as input. Extends the JobTemplate class.

Attributes

AttributeDescription
title

str

The title of the output objects: STAC item and STAC collection.

item

pystac.Item

The STAC item to process.

Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
UP42_client = up42.stac_client()
stac_item = next(UP42_client.get_items(stac_item_id))
# Instanitate a TrueColorConversion template
job_template = processing_templates.TrueColorConversion(
title="Imagery over UK",
item=stac_item,
)

Subclasses

Class nameProcess IDProcess
TrueColorConversiontrue-color-conversionTrueColorConversion

Learn more

API docs | Processing Console docs | Processing