Python Runtime for Kinetic Instructions
Project description
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/awaitsupport - 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kirun_py-3.3.3.tar.gz.
File metadata
- Download URL: kirun_py-3.3.3.tar.gz
- Upload date:
- Size: 130.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abc7635d30b4863e2898401da78b9bb08496fe857d0e0b290fcf24a717342506
|
|
| MD5 |
7b0f740744482bf2ff5fb15d1bdeb430
|
|
| BLAKE2b-256 |
e0ef49009d943c9ccbeae32d8a23f929d1a1d97e6503f7f7f1567dcadea0c60b
|
Provenance
The following attestation bundles were made for kirun_py-3.3.3.tar.gz:
Publisher:
python-publish.yml on modlix-india/nocode-kirun
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kirun_py-3.3.3.tar.gz -
Subject digest:
abc7635d30b4863e2898401da78b9bb08496fe857d0e0b290fcf24a717342506 - Sigstore transparency entry: 1214661035
- Sigstore integration time:
-
Permalink:
modlix-india/nocode-kirun@237ff4d0d5f3d28b776232cf20b0d8467016d046 -
Branch / Tag:
refs/tags/kirun-py-3.3.3 - Owner: https://github.com/modlix-india
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@237ff4d0d5f3d28b776232cf20b0d8467016d046 -
Trigger Event:
release
-
Statement type:
File details
Details for the file kirun_py-3.3.3-py3-none-any.whl.
File metadata
- Download URL: kirun_py-3.3.3-py3-none-any.whl
- Upload date:
- Size: 253.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b06a6165a36510ac49d1e3a98b7d5f3a5860656fab02fe203fb3627d674532e
|
|
| MD5 |
9176f4bda260a7d97d8c9d514630e7e9
|
|
| BLAKE2b-256 |
ef2363499dcad93f5822d67058322a3d57c6b35688d826c1282362b323c45e80
|
Provenance
The following attestation bundles were made for kirun_py-3.3.3-py3-none-any.whl:
Publisher:
python-publish.yml on modlix-india/nocode-kirun
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kirun_py-3.3.3-py3-none-any.whl -
Subject digest:
8b06a6165a36510ac49d1e3a98b7d5f3a5860656fab02fe203fb3627d674532e - Sigstore transparency entry: 1214661104
- Sigstore integration time:
-
Permalink:
modlix-india/nocode-kirun@237ff4d0d5f3d28b776232cf20b0d8467016d046 -
Branch / Tag:
refs/tags/kirun-py-3.3.3 - Owner: https://github.com/modlix-india
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@237ff4d0d5f3d28b776232cf20b0d8467016d046 -
Trigger Event:
release
-
Statement type: