Skip to main content

Komus Tasks SDK (Python)

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

Installation

First public PyPI release: 1.0.0 (ko-tasks CLI and bundled agent skills).

pip install ko-tasks-sdk

Quick Start

1. Create a new task

ko-tasks 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

ko-tasks run

4. Deploy

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

CLI Commands

Command Description
ko-tasks init <name> Scaffold a new task project
ko-tasks run Start a local dev server
ko-tasks package --task-dir . -o task.zip Package task for deployment
ko-tasks deploy -s URL --admin-key KEY Deploy to remote server
ko-tasks status <thread_id> -s URL --api-key KEY Check thread status
ko-tasks list -s URL --admin-key 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/Komus-ai/ko-tasks-platform.git
cd ko-tasks-platform

# Install in development mode
uv sync

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

License

MIT

Release files for ko-tasks-sdk 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ko-tasks-sdk 1.0.0
File Size Uploaded
ko_tasks_sdk-1.0.0.tar.gz 167.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ko-tasks-sdk 1.0.0
File Interpreter ABI Platform
ko_tasks_sdk-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 414.6 kB

Release files / ko_tasks_sdk-1.0.0.tar.gz

Download URL ko_tasks_sdk-1.0.0.tar.gz
Size 167.3 kB
Tags Source
SHA-256 checksum
How to use checksums
541b3b85bf94ae79c594cfbd3082f55b61c21a30766a044264803c9236d3459b
BLAKE2b-256 checksum
How to use checksums
ff77b1f9bf9d3703e94a02bc05e2f4148bfc05134efd18f9b1464bce3c39183a
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / ko_tasks_sdk-1.0.0-py3-none-any.whl

Download URL ko_tasks_sdk-1.0.0-py3-none-any.whl
Size 247.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55bcdc92d09b44e31133ba8a94cb90b182ac6f2398072cf159ab6a7ff09d5ecf
BLAKE2b-256 checksum
How to use checksums
b868e65f9683591f8bcefe8d486d3d411bf79033c63f965e3593ebd41a4ae78f
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page