Skip to main content

kirun

kirun-py: the Python runtime for KIRun

Playground · Docs · Functions · GitHub

PyPI MIT License


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
  • 166 built-in functions — Math, String, Array, Object, Date, JSON, Loop, Context (catalog)
  • Async execution — full async/await support
  • Debug support — execution tracing and performance profiling
  • DSL — kirun_py.dsl.dsl_compiler.DSLCompiler compiles the KIRun text format to JSON and back

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 Count Some of them
System 6 If, GenerateEvent, Print, Wait, Make, ValidateSchema
System.Math 32 Add, Absolute, Floor, Ceiling, Round, Power, Minimum, Maximum, Random, ...
System.String 33 Concatenate, Split, Trim, Replace, IndexOf, SubString, UpperCase, LowerCase, ...
System.Array 31 AddFirst, InsertLast, Delete, Sort, Reverse, IndexOf, SubArray, Join, ...
System.Object 6 ObjectKeys, ObjectValues, ObjectEntries, ObjectPutValue, ObjectDeleteKey, ObjectConvert
System.Date 49 GetCurrentTimestamp, AddTime, SubtractTime, Difference, StartOf, EndOf, FromNow, ...
System.Loop 4 RangeLoop, CountLoop, ForEachLoop, Break
System.Context 3 Create, Get, Set
System.JSON 2 JSONParse, JSONStringify

Every function, with its signature and an example you can run, is in the function catalog.

Requirements

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

License

MIT

Metadata

Release files for kirun-py 3.9.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.9.0
File Size Uploaded Provenance Actions
kirun_py-3.9.0.tar.gz 141.7 kB With provenance Details for kirun_py-3.9.0.tar.gz

Built distribution (wheel)

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

Total release size: 406.2 kB

Release files / kirun_py-3.9.0.tar.gz

Download URL kirun_py-3.9.0.tar.gz
Size 141.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f9a6037f02bd8960448519af4772747c3f31b208479551e351488a94839146db
BLAKE2b-256 checksum
How to use checksums
da256668994c20d65070855c1c3987c056898a5a5613e7388a43f5291d181757
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 31, 2026.

Transparency log

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

Download URL kirun_py-3.9.0-py3-none-any.whl
Size 264.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1cd3d01e1b0995a28d188045f0f709cdb9778a8365841a509a40cd524cdbbc9
BLAKE2b-256 checksum
How to use checksums
ea91bef4b1f8c79c627d10abb9d84d058703d2e0a9d387b3c4041c2559747ebf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 31, 2026.

Transparency log

Security for kirun-py 3.9.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.9.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 Oct 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