Skip to main content

kirun-py

Python runtime for KIRun — the Kinetic Instructions execution engine used by the Modlix no-code/low-code platform.

Installation

pip install kirun-py

Overview

KIRun executes FunctionDefinition graphs (DAGs) with:

  • Expression evaluation — arithmetic, logical, string, ternary operators
  • Schema validation — JSON Schema-based type checking
  • 100+ built-in functions — Math, String, Array, Object, Date, JSON, Loop, Context
  • Async execution — full async/await support
  • Debug support — execution tracing and performance profiling

Quick Start

import asyncio
import json
from kirun_py.model.function_definition import FunctionDefinition
from kirun_py.runtime.ki_runtime import KIRuntime
from kirun_py.runtime.function_execution_parameters import FunctionExecutionParameters
from kirun_py.repository.ki_run_function_repository import KIRunFunctionRepository
from kirun_py.repository.ki_run_schema_repository import KIRunSchemaRepository

fd = FunctionDefinition.from_value(json.loads("""
{
    "name": "AddTwo",
    "namespace": "MyApp",
    "parameters": {
        "a": { "parameterName": "a", "schema": { "name": "a", "type": "INTEGER" } },
        "b": { "parameterName": "b", "schema": { "name": "b", "type": "INTEGER" } }
    },
    "events": {
        "output": {
            "name": "output",
            "parameters": { "result": { "name": "result", "type": "INTEGER" } }
        }
    },
    "steps": {
        "gen": {
            "statementName": "gen",
            "namespace": "System",
            "name": "GenerateEvent",
            "parameterMap": {
                "eventName": { "one": { "key": "one", "type": "VALUE", "value": "output" } },
                "results": {
                    "one": {
                        "key": "one", "type": "VALUE",
                        "value": {
                            "name": "result",
                            "value": { "isExpression": true, "value": "Arguments.a + Arguments.b" }
                        }
                    }
                }
            }
        }
    }
}
"""))

async def main():
    runtime = KIRuntime(fd)
    repo = KIRunFunctionRepository()
    schema_repo = KIRunSchemaRepository()
    output = await runtime.execute(
        FunctionExecutionParameters(repo, schema_repo)
            .set_arguments({"a": 3, "b": 4})
    )
    result = output.next()
    print(result.get_result().get("result"))  # 7

asyncio.run(main())

Built-in Function Namespaces

Namespace Functions
System If, GenerateEvent, Print, Wait, Make, ValidateSchema
System.Math Add, Subtract, Multiply, Divide, Power, Abs, Floor, Ceil, Round, Random, Min, Max, ...
System.String Concat, Split, Trim, Replace, IndexOf, SubString, ToUpperCase, ToLowerCase, ...
System.Array AddElement, RemoveElement, Sort, Filter, Map, Reduce, IndexOf, Reverse, ...
System.Object Get, Set, Keys, Values, Entries, Merge
System.Date Now, Format, Parse, AddDuration, Difference, StartOf, EndOf, ...
System.Loop RangeLoop, CountLoop, ForEachLoop, Break
System.Context Create, Get, Set
System.JSON Parse, Stringify

Requirements

  • Python >= 3.9
  • python-dateutil >= 2.8

License

MIT

Metadata

Release files for kirun-py 3.5.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 kirun-py 3.5.0
File Size Uploaded Provenance Actions
kirun_py-3.5.0.tar.gz 131.1 kB With provenance Details for kirun_py-3.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kirun-py 3.5.0
File Interpreter ABI Platform Actions
kirun_py-3.5.0-py3-none-any.whl Python 3 none any Details for kirun_py-3.5.0-py3-none-any.whl

Total release size: 385.5 kB

Release files / kirun_py-3.5.0.tar.gz

Download URL kirun_py-3.5.0.tar.gz
Size 131.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7a0579b55ee2c28f0c005a67429c32773877ed6ac55a3810876a61475dc32882
BLAKE2b-256 checksum
How to use checksums
0279e244ba7982e5b54e7dfef468ce5f0b743503c7741fe64e496d389a56743c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

Release files / kirun_py-3.5.0-py3-none-any.whl

Download URL kirun_py-3.5.0-py3-none-any.whl
Size 254.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53b2084f2ca8d1f74a0e3020edf9b77699445d93afd9b72a5afa9bf5f1e37b16
BLAKE2b-256 checksum
How to use checksums
bf25e2d7917c6a07d02d57c614a115135ddb7ad51ca58458e5398a3acc00f330
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

Security for kirun-py 3.5.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kirun_py-3.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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