|
| 1 | +stactask.Task — instance reference |
| 2 | +================================= |
| 3 | + |
| 4 | +This file lists the most important attributes, properties, and methods |
| 5 | +available on a Task instance (what you can access via self) with concise |
| 6 | +definitions. |
| 7 | + |
| 8 | +This documentation is provided to make the user aware of stac-task's features. To learn |
| 9 | +more see ``src/stactask/task.py``. |
| 10 | + |
| 11 | +.. _instance_attributes: |
| 12 | +.. _properties: |
| 13 | +.. _instance_methods: |
| 14 | + |
| 15 | +Instance attributes |
| 16 | +------------------- |
| 17 | + |
| 18 | +* **payload (Payload)**: The validated Cirrus process payload wrapped in the |
| 19 | + Payload helper class. Primary access point for process, workflow, task, upload |
| 20 | + options, and features. |
| 21 | +* **logger (TaskLoggerAdapter)**: Pre-configured logger that includes task |
| 22 | + metadata (task name/version) and can be used for task logging. |
| 23 | +* **s3 (boto3utils.s3)**: If present, convenience S3 client utility for |
| 24 | + reading/writing S3 objects (used by convenience helpers). |
| 25 | + |
| 26 | +Properties |
| 27 | +---------------------------------------------------- |
| 28 | + |
| 29 | +Properties can be accessed via ``self.<name>`` |
| 30 | + |
| 31 | +* **process_definition (dict)**: Convenience accessor for the first element of |
| 32 | + the payload ``process`` list (top-level process configuration for this run). |
| 33 | +* **workflow_options (dict)**: Workflow-level options from the process |
| 34 | + definition (global parameters for the workflow). |
| 35 | +* **task_options (dict)**: Options for this task: the mapping located at |
| 36 | + ``process.tasks[self.name]`` if present, otherwise an empty dict. |
| 37 | +* **parameters (dict)**: Merged parameters, typically ``workflow_options`` merged |
| 38 | + with ``task_options`` (task-level overrides workflow-level). |
| 39 | +* **upload_options (dict)**: Upload-related options from the process definition |
| 40 | + (path templates, headers, collections). |
| 41 | +* **collection_matchers (list[dict])**: List of collection-matcher definitions |
| 42 | + (JSONPath-based rules used to assign collection names to items). |
| 43 | +* **items_as_dicts (list[dict])**: The features list from the payload (each |
| 44 | + element is a STAC Item as a plain dict). |
| 45 | +* **items (pystac.ItemCollection)**: A pystac.ItemCollection built from the |
| 46 | + payload features for convenience when working with pystac Item objects. |
| 47 | + |
| 48 | +Instance methods |
| 49 | +---------------- |
| 50 | + |
| 51 | +* **assign_collections**: Assign collection names to items in the payload using |
| 52 | + ``collection_matchers`` mapping. |
| 53 | +* **download_item_assets**: Convenience wrapper to download assets for |
| 54 | + a single Item. Given a pystac.Item, the Task will download each asset's file to its |
| 55 | + local work directory and will update each asset's href. |
| 56 | +* **download_items_assets**: Batch variant of ``download_item_assets`` that downloads |
| 57 | + assets for multiple items concurrently (uses asyncio under the hood). |
| 58 | +* **upload_item_assets_to_s3**: Upload local assets referenced by an Item to S3 |
| 59 | + (based on path templates) and update asset hrefs to their uploaded |
| 60 | + locations. This is an S3-specific helper retained for compatibility. |
| 61 | +* **upload_local_item_assets_to_s3**: Helper to find assets whose hrefs point to the |
| 62 | + local workdir and upload only those to S3 (based on path templates), updating hrefs. |
| 63 | +* **upload_item_to_s3**: Upload a single Item JSON to S3 (based on path templates) as a |
| 64 | + JSON file. |
0 commit comments