Skip to main content

Python SDK for Nexora Tasks — define, test, and deploy task workflows

Project description

Nexora Tasks SDK (Python)

Python SDK for building, testing, and deploying tasks with the Nexora Tasks.

Installation

pip install nexora-tasks-sdk

Quick Start

1. Create a new task

task init my-task --runtime python
cd my-task

2. Edit task.py

async def run(context):
    context.report_progress(0.0, "Starting...")

    inputs = context.get_inputs()
    # ... your logic ...

    context.report_progress(1.0, "Done")
    return [{"kind": "text", "text": "Result"}]

3. Run locally

task run

4. Deploy

task deploy --server https://tasks.example.com --key YOUR_ADMIN_KEY

CLI Commands

Command Description
task init <name> Scaffold a new task project
task run Start a local dev server
task package -t . -o task.zip Package task for deployment
task deploy -s URL -k KEY Deploy to remote server
task status <thread_id> -s URL -k KEY Check thread status
task list -s URL -k KEY List deployed tasks

TaskContext API

The context object passed to your task function provides:

Inputs & Outputs

  • context.get_inputs() — Returns list of input artifacts
  • Return a list of output artifacts from your function

Progress Reporting

  • context.report_progress(fraction, message) — Report progress (0.0 to 1.0)

Cooperative Control

  • context.check_pause() — Blocks if task is paused, raises if cancelled
  • context.is_paused() — Returns True if pause requested
  • context.is_cancelled() — Returns True if cancellation requested

Artifacts

  • context.store_artifact(data, filename, media_type) — Store output artifact
  • context.get_artifact(artifact_id) — Retrieve an artifact

Configuration

  • context.get_config(key) — Get a configuration/credential value

Task Definition (task.yaml)

name: my-task
version: 1.0.0
description: "What the task does"
entry_point: task:run
runtime: python                   # python | node

input_schemas:
  - ref: input_data
    kind: text
    required: true
    description: "Input description"

output_schemas:
  - kind: file
    media_type: application/pdf
    description: "Output description"

requirements:
  - name: API_KEY
    required: true
    description: "External API key"

Development

# Clone the monorepo
git clone https://github.com/Tessi-Wekey/tasks-platform.git
cd tasks-platform

# Install in development mode
uv sync

# Run SDK tests
uv run --package nexora-tasks-sdk pytest packages/sdk-python/tests/ -v

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexora_tasks_sdk-1.0.3.tar.gz (116.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexora_tasks_sdk-1.0.3-py3-none-any.whl (164.9 kB view details)

Uploaded Python 3

File details

Details for the file nexora_tasks_sdk-1.0.3.tar.gz.

File metadata

  • Download URL: nexora_tasks_sdk-1.0.3.tar.gz
  • Upload date:
  • Size: 116.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nexora_tasks_sdk-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b5805d21c95c8ec3f8f0fa5a575be0e7116bef95a332cbcd0109cfb88f811acc
MD5 567feab1e88102af101dd5ee2f07467c
BLAKE2b-256 2ae5b9f5fe3f1b5ea72fae1e645cb44d9597ddbadd0f966c5833fc480c862bfa

See more details on using hashes here.

File details

Details for the file nexora_tasks_sdk-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: nexora_tasks_sdk-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 164.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nexora_tasks_sdk-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8adbeca96383f67196f468788f11250c4bf10fcf6b6dd1502e4bd2ed5b6b98d2
MD5 8ad2d7b99934a93f402b87e8871db883
BLAKE2b-256 cf67256a6c1f497f9b71061ac0d6d3034630ac6e8ca7790a7e8abc9b9fb1e57b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page