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.1

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.1
File Size Uploaded Provenance Actions
kirun_py-3.9.1.tar.gz 142.3 kB With provenance Details for kirun_py-3.9.1.tar.gz

Built distribution (wheel)

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

Total release size: 407.4 kB

Release files / kirun_py-3.9.1.tar.gz

Download URL kirun_py-3.9.1.tar.gz
Size 142.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a4fbdbc71d5fb59a89ad168e1c90e1dd26c94ef1b4069268c04ed52ed00f6663
BLAKE2b-256 checksum
How to use checksums
0b7c714737522037c36fe48d59fbec480fd89bc67b214785da981461e5b1fd03
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 Nov 7, 2026.

Transparency log

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

Download URL kirun_py-3.9.1-py3-none-any.whl
Size 265.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f60f5930b115b023f5c47a4a52c1e19da98121c274cd9c27c15b25a6e5c7b78
BLAKE2b-256 checksum
How to use checksums
1dac449fcb347bab20689f9668f3e42188250e997d7383db6f2afe5b9e73c9a4
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 Nov 7, 2026.

Transparency log

Security for kirun-py 3.9.1

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.1.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 Nov 7, 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