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.1.tar.gz (116.3 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.1-py3-none-any.whl (165.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nexora_tasks_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 116.3 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.1.tar.gz
Algorithm Hash digest
SHA256 dd4400ca25d1165da7d8d23973179865aa5e0ca79352b16b3b5c399a811f7b62
MD5 41a4d116fd8133d159c266dc0f240eee
BLAKE2b-256 df6a7d67a3319c77947dc840eb4cb8911fd60b1f7158ae77255ca23245ddc7e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nexora_tasks_sdk-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 165.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5d22a9d1cde41fdbc03e279c83c434164e54c871d47431758bb058c747f3276
MD5 28bffadfc1bf97c77193fabf72ba1701
BLAKE2b-256 b6dad3be5abf16d9069633e5eb8aac5f040c53e452f192b7f824f7fdbf1c03f7

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