Skip to main content

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

Project description

Task Framework Python SDK

Python SDK for building, testing, and deploying tasks with the Task Framework.

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 task-framework

# 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.0.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.0-py3-none-any.whl (165.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nexora_tasks_sdk-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 7965989fb5ebfb2737288eb62d411fcb78911dd4d7489577404dc9a94d10b8dd
MD5 b0a1e4f177531c3c1d198a4ee83fc805
BLAKE2b-256 2942c83641e3f8d2700b90a8add23a2b97b9ae90c4f2da3691b2a40275f1d75d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nexora_tasks_sdk-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d432fb09174d1d68190df11009ab08059acf6b1ce6dc4e4ed0fb30e806f3ad1
MD5 4484efdd278e86a12621c90084cced6f
BLAKE2b-256 6cb458ee6d9aa1e82450be3494734f59f1d1c5654bdf05bf50460f2a2533858e

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