orchestra-lang
Parse, validate, and transpile Orchestra pipeline definitions from Python.
orchestra-lang is the Python binding for the Orchestra pipeline DSL — the same
engine that powers the Orchestra VS Code extension. It ships the dialect's schema
and validators as a native library, so you get full dialect-aware parsing and
validation without calling out to a separate process.
About the dialect
Orchestra pipelines are authored in a KSON-based DSL for defining, validating, and shipping data pipelines. A pipeline describes tasks, dependencies, conditions, triggers, and variables across 100+ integrations (Snowflake, dbt, Fivetran, Databricks, and more).
A minimal pipeline looks like this:
version: v1
name: "task-references"
pipeline:
producer:
integration: SNOWFLAKE
integration_job: SNOWFLAKE_RUN_QUERY
parameters:
set_outputs: true
statement: "SELECT 1"
.
.
consumer:
integration: SNOWFLAKE
integration_job: SNOWFLAKE_RUN_QUERY
condition: "${{ tasks['producer'].status == 'SUCCEEDED' }}"
parameters:
statement: "SELECT ${{ tasks['producer'].outputs['count'] }}"
.
depends_on: [producer]
.
.
The trailing . closes a block — KSON's alternative to significant dedent.
The dialect validates required fields and types, integration-specific parameters, variable references and expressions, task dependencies, cron syntax, and branching conditions. See the Orchestra documentation for the full language reference.
Installation
pip install orchestra-lang
Then import it as oml_lang:
import oml_lang
Wheels are published for Linux (x86_64, aarch64), macOS (Apple Silicon) and Windows (x86_64), on CPython 3.10 and newer.
API
Five top-level functions; most return the underlying engine's own result
object so you can introspect errors, tokens and values directly, while format
returns a plain string.
analyze(kson: str) -> Analysis
Statically analyze an Orchestra document. The bundled engine runs the
Orchestra dialect validators automatically, so analyze catches parse
errors, schema violations, expression syntax errors, bad task
references, circular dependencies, invalid cron expressions, and so on.
import oml_lang
src = open("pipeline.oml").read()
analysis = oml_lang.analyze(src)
for msg in analysis.errors():
start = msg.start()
print(f"[{msg.severity()}] {start.line()}:{start.column()} {msg.message()}")
Example output for a pipeline with a broken condition expression and missing required fields:
[MessageSeverity.ERROR] 3:53 Expression syntax error: Expected RPAREN but got ''
[MessageSeverity.WARNING] 0:0 Missing required properties: version, name
The Analysis object
Analysis exposes three views of the analyzed document:
-
errors() -> list[Message]— every error and warning produced by the parser, schema validator, and dialect validators. EachMessagecarries aseverity()(MessageSeverity.ERRORorMessageSeverity.WARNING), amessage()string, andstart()/end()Positions whoseline()andcolumn()methods return zero-based offsets. An empty list means the document is valid. -
tokens() -> list[Token]— the full lexed token stream, useful for syntax highlighting and editor tooling. EachTokenhastoken_type()(aTokenTypeenum),text(), andstart()/end()positions. -
kson_value() -> KsonValue | None— the parsed document as a typed value tree, orNoneif parsing failed fatally. Calltype()to get aKsonValueTypediscriminator, orisinstancecheck againstKsonValue.KsonObject,KsonValue.KsonArray,KsonValue.KsonString,KsonValue.KsonNumber,KsonValue.KsonBoolean,KsonValue.KsonNull, orKsonValue.KsonEmbedto walk the tree.
from oml_lang import analyze, KsonValue
analysis = analyze(src)
root = analysis.kson_value()
if isinstance(root, KsonValue.KsonObject):
# ... walk the object
...
to_json(kson: str, options: TranspileOptions.Json) -> Result
Transpile Orchestra source to JSON. Returns a Result — pattern-match on
Result.Success / Result.Failure:
from oml_lang import to_json, Result, TranspileOptions
result = to_json(src, TranspileOptions.Json(retain_embed_tags=False))
if isinstance(result, Result.Success):
print(result.output())
else:
for err in result.errors():
print(err.message())
to_yaml(kson: str, options: TranspileOptions.Yaml) -> Result
Same shape as to_json, but emits YAML and preserves comments.
from oml_lang import to_yaml, TranspileOptions
result = to_yaml(src, TranspileOptions.Yaml(retain_embed_tags=False))
format(kson: str, format_options: FormatOptions) -> str
Pretty-print Orchestra source with the given formatting options. Applies the
dialect's embed-block rules but not its validators, so this is lossless
reformatting, not validation — run analyze to validate.
import oml_lang
from oml_lang import FormatOptions, FormattingStyle, IndentType
formatted = oml_lang.format(
src,
FormatOptions(
indent_type=IndentType.Spaces(2),
formatting_style=FormattingStyle.PLAIN,
embed_block_rules=[],
),
)
parse_schema(schema_kson: str) -> SchemaResult
Parse a KSON JSON-Schema document and, on success, return a reusable
SchemaValidator.
from oml_lang import parse_schema, SchemaResult
result = parse_schema(open("my.schema.kson").read())
if isinstance(result, SchemaResult.Success):
validator = result.schema_validator()
messages = validator.validate(src, "document.oml")
Links
- Orchestra documentation — the full language reference
- Orchestra Language for VS Code — the same engine, with autocomplete and inline validation in the editor
- Orchestra
- KSON language
Release files for orchestra-lang 2026.922.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| orchestra_lang-2026.922.2-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| orchestra_lang-2026.922.2-cp310-abi3-manylinux_2_34_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ x86-64 | Details |
| orchestra_lang-2026.922.2-cp310-abi3-manylinux_2_34_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ ARM64 | Details |
| orchestra_lang-2026.922.2-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 79.4 MB
Release files / orchestra_lang-2026.922.2-cp310-abi3-win_amd64.whl
| Download URL | orchestra_lang-2026.922.2-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 19.3 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5df6a9abf555c10e297a17e0da21257bd96288c867bbc700f20824eea23ccc74
|
|
BLAKE2b-256 checksum How to use checksums |
e86bc17e1402f39a1cdd67c11b9138ceebab3e547ebc71883695b929683031cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / orchestra_lang-2026.922.2-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | orchestra_lang-2026.922.2-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 20.8 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b98ac941cf31c0cb84d65aff3dcde0301e68d3303298840da0e9fa90bbc6a4ee
|
|
BLAKE2b-256 checksum How to use checksums |
44895426f5543f7ace9227f50f0a4ac698ca5d2e54aed050146bb88d9ea86143
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / orchestra_lang-2026.922.2-cp310-abi3-manylinux_2_34_aarch64.whl
| Download URL | orchestra_lang-2026.922.2-cp310-abi3-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 20.4 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7b5d5e1991dfc0ad3d6ed4f8a88e6a1f37b09eaeaf68813507bf572d240514bb
|
|
BLAKE2b-256 checksum How to use checksums |
9a7e4cfaf3f531abfb4432f5ecc0389fefa70dd3d5d5de0b4a2229b80cd3f9e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / orchestra_lang-2026.922.2-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | orchestra_lang-2026.922.2-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 18.9 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ee5eacc9025692609cefddf34f854819b479fd061fc41a6ce0c6de333469be05
|
|
BLAKE2b-256 checksum How to use checksums |
7e4bbd2d2a427c9fe34b517277b13f3cc8d860ea8c4427adde408a9d846d4bc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|