Skip to main content

iii-sdk

Python SDK for the iii engine.

PyPI Python License

Install

pip install iii-sdk

Hello World

from iii import register_worker

iii = register_worker("ws://localhost:49134")

def greet(data):
    return {"message": f"Hello, {data['name']}!"}

iii.register_function("hello::greet", greet)

iii.register_trigger({
    "type": "http",
    "function_id": "hello::greet",
    "config": {"api_path": "/greet", "http_method": "POST"},
})

iii.connect()

result = iii.trigger({"function_id": "hello::greet", "payload": {"name": "world"}})
print(result)  # {"message": "Hello, world!"}

API

Operation Signature Description
Initialize register_worker(url, options?) Create an SDK instance and auto-connect
Register function iii.register_function(id, handler) Register a function that can be invoked by name
Register trigger iii.register_trigger({"type": ..., "function_id": ..., "config": ...}) Bind a trigger (HTTP, cron, queue, etc.) to a function
Invoke (await result) iii.trigger({"function_id": id, "payload": data}) Invoke a function and wait for the result
Invoke (fire-and-forget) iii.trigger({"function_id": id, ..., "action": TriggerAction.Void()}) Fire-and-forget
Invoke (enqueue) iii.trigger({"function_id": id, ..., "action": TriggerAction.Enqueue(queue="name")}) Route invocation through a named queue
Shutdown iii.shutdown() Disconnect and stop background thread

register_worker() creates the SDK instance and auto-connects to the engine.

Registering Functions

def create_order(data):
    return {"status_code": 201, "body": {"id": "123", "item": data["body"]["item"]}}

iii.register_function("orders::create", create_order)

Registering Triggers

iii.register_trigger({
    "type": "http",
    "function_id": "orders::create",
    "config": {"api_path": "/orders", "http_method": "POST"},
})

Invoking Functions

result = iii.trigger({"function_id": "orders::create", "payload": {"body": {"item": "widget"}}})

Development

Install in development mode

pip install -e .

Type checking

mypy src

Linting

ruff check src

Resources

Metadata

Release files for iii-sdk 0.24.6

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

Source distribution (sdist)

Source distribution for iii-sdk 0.24.6
File Size Uploaded Provenance
iii_sdk-0.24.6.tar.gz 214.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for iii-sdk 0.24.6
File Interpreter ABI Platform
iii_sdk-0.24.6-py3-none-any.whl Python 3 none any Details

Total release size: 260.4 kB

Release files / iii_sdk-0.24.6.tar.gz

Download URL iii_sdk-0.24.6.tar.gz
Size 214.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f081ed236b115931e2f8783e262fea9ac71b2f542d451ae610b430e64280131
BLAKE2b-256 checksum
How to use checksums
609aba05541cfd18e66b697ee033ae3ab93205ca202b6351b05717ad50d8c7ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / iii_sdk-0.24.6-py3-none-any.whl

Download URL iii_sdk-0.24.6-py3-none-any.whl
Size 45.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c75c06093bc3beb60e5ac3725c4530dcfb0a0596f0ee1647de091c0d3d8f00f
BLAKE2b-256 checksum
How to use checksums
b9de5b5f186ed00dd83c82db489202654c57d7b8e9439976e85d2d863642e928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for iii-sdk 0.24.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.24.6 This release

2 release files No provenance

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