Skip to main content

III SDK for Python

Project description

III SDK for Python

Python SDK for the III Engine.

Installation

pip install iii-sdk

Usage

import asyncio
from iii import III

async def my_function(data):
    return {"result": "success"}

iii = III("ws://localhost:49134")
iii.register_function("my.function", my_function)

async def main():
    await iii.connect()

    result = await iii.call("other.function", {"param": "value"})
    print(result)

asyncio.run(main())

Register API trigger

import asyncio
from iii import III, ApiRequest, ApiResponse

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

async def create_todo(data):    
    req = ApiRequest(**data)
    return ApiResponse(status=201, data={"id": "123", "title": req.body.get("title")})

iii.register_function("api.post.todo", create_todo)

async def main():
    await iii.connect()

    iii.register_trigger(
        trigger_type="api",
        function_id="api.post.todo",
        config={
            "api_path": "/todo",
            "http_method": "POST",
            "description": "Create a new todo"
        }
    )

asyncio.run(main())

Features

  • WebSocket-based communication with III Engine
  • Function registration and invocation
  • Trigger registration
  • Context-aware logging
  • Async/await support

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

iii_sdk-0.1.0.post1.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iii_sdk-0.1.0.post1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file iii_sdk-0.1.0.post1.tar.gz.

File metadata

  • Download URL: iii_sdk-0.1.0.post1.tar.gz
  • Upload date:
  • Size: 49.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iii_sdk-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 a47c2abeb5566d62ca6c2d0ef6a711c111691072a134e35176d2015f111d0af4
MD5 0609cadf014c49b4627b5b5ae6478f92
BLAKE2b-256 7158997133691bb19b4131b65ae44f88b0e4b85f7036a01cc2d463004b72c336

See more details on using hashes here.

File details

Details for the file iii_sdk-0.1.0.post1-py3-none-any.whl.

File metadata

  • Download URL: iii_sdk-0.1.0.post1-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iii_sdk-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a7836b80154aac23b82c461509edcbd7d6e32717710e435079dfff3973ff027
MD5 81b5124c410253f111e1b464d1d8e180
BLAKE2b-256 2ce745ed24922230610da1edfac913b75641b67e701c7d8aace90f79ad695b1d

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