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.2.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.2-py3-none-any.whl (164.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nexora_tasks_sdk-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 799043191e258babf03b2473e87fe8e884a689ed273d563e29281ada82fad5f5
MD5 2607fb669eb3223e532a3bdcc91532d7
BLAKE2b-256 37eedaed48fc4d18e3ed7ab6a07bfd4851d18514f096035673c27f2e7c7728f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nexora_tasks_sdk-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fb14789050d3ef391bd7327c3ddc0adc1ecf03927ff0636f23459d01fe08f972
MD5 246b77abc7f29cc92e91107a7523bc9a
BLAKE2b-256 534cd832a2510e01d80bee59fe663f686984ff8e5aa6ed1a060b67a92691d840

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