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.6.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.6.0
File Size Uploaded Provenance Actions
kirun_py-3.6.0.tar.gz 131.9 kB With provenance Details for kirun_py-3.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 386.8 kB

Release files / kirun_py-3.6.0.tar.gz

Download URL kirun_py-3.6.0.tar.gz
Size 131.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4657aaf2df88f72991acda23b02ff413ef43b86674af661aecea3bf0e52da62c
BLAKE2b-256 checksum
How to use checksums
7305c45df4012caf8dcc6930ed8b6ee37d5f5a742d8f6124196222be21c01f43
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 Aug 31, 2026.

Transparency log

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

Download URL kirun_py-3.6.0-py3-none-any.whl
Size 255.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0177c120386c3879eaa77bee4c8265f093ed27a2f11993bd4118b2d44fe3a3f
BLAKE2b-256 checksum
How to use checksums
bd9e5c3ed77c1aa4590971ca0865f19b23a06fb27b9ae05c5f892c1e079efa2a
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 Aug 31, 2026.

Transparency log

Security for kirun-py 3.6.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.6.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 Aug 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