Skip to main content

osi-orionbelt

Bidirectional converter between OBML (OrionBelt Markup Language) semantic models and OSI (Open Semantic Interchange), the open standard for portable semantic models (metrics, dimensions, relationships).

This package is licensed under Apache-2.0 and may be used freely. It is the OrionBelt converter in the OSI converter ecosystem. The canonical source is developed in the orionbelt-semantic-layer repository (under packages/osi-orionbelt) and published to PyPI from there; file issues and contributions upstream.

Requirements

  • Python 3.12+
  • uv (recommended) or pip

Install

pip install osi-orionbelt

Optional deep OBML semantic validation (cycles, duplicate names, invalid refs) via the full OrionBelt engine:

pip install "osi-orionbelt[obml-validation]"

Without that extra, OBML validation runs JSON-schema checks only and emits a warning for the deeper semantic pass.

CLI

A single osi-orionbelt command with two subcommands (mirroring osi-dbt):

Subcommand Direction In Out
obml-to-osi OBML -> OSI core-spec OBML YAML OSI YAML
obml-to-osi --ontology OBML -> OSI ontology OBML YAML OSI ontology YAML
osi-to-obml OSI core-spec -> OBML OSI YAML OBML YAML
osi-orionbelt obml-to-osi -i model.obml.yaml -o model.osi.yaml
osi-orionbelt obml-to-osi --ontology -i model.obml.yaml -o model.ontology.yaml
osi-orionbelt osi-to-obml -i model.osi.yaml -o model.obml.yaml

-i/--input and -o/--output are required. Each subcommand prints conversion warnings and a validation summary to stderr, and exits non-zero when the produced document fails schema validation (unless --no-validate). Run osi-orionbelt --help or osi-orionbelt obml-to-osi --help for the full option list.

Python API

import yaml
from osi_orionbelt import OBMLtoOSI, OSItoOBML, validate_osi

obml = yaml.safe_load(open("model.obml.yaml"))
osi = OBMLtoOSI(obml, "sales", "Sales model").convert()
result = validate_osi(osi)
assert result.valid

obml_again = OSItoOBML(osi).convert()

Vendor extensions

OSI custom_extensions carry vendor-tagged payloads. This converter:

  • emits OrionBelt/OBML-proprietary data under the ORIONBELT vendor on OBML to OSI (OBML-only filters, settings, owner, refresh, type info, etc.);
  • stashes OSI-native fields that OBML can't represent (unique keys, field labels, leftover ai_context) under the OSI vendor when going OSI to OBML, restoring them to first-class OSI fields on the way back;
  • preserves third-party vendor extensions verbatim (e.g. SNOWFLAKE, DBT, SALESFORCE, GOODDATA) at the model, dataset, field, and measure/metric levels, so a full OSI to OBML to OSI roundtrip keeps the original vendor and data. OSI has no separate dimension entity, so an OBML dimension's foreign extensions surface on its OSI field.

Legacy COMMON / OBSL tags from earlier converter versions are still accepted on read.

Limitations / unsupported constructs

Some OBML constructs have no native OSI equivalent and are carried in vendor custom_extensions (obml_* payloads) so they round-trip without loss back to OBML, but are not interpreted by other OSI consumers:

  • Many-to-many joins - represented in OBML join cardinality; flagged on export.
  • Named secondary join paths - OBML's multiple join paths between the same pair of objects are an OBML-specific topology feature.
  • Measures / metrics and column-level value concepts in the ontology layer - not represented in the OSI ontology export.
  • OSI metrics with no OBML representation - a metric whose only expression is in a non-SQL dialect (MDX, TABLEAU, MAQL), or whose SQL expression cannot be decomposed into OBML measures/metrics, is not dropped: the original OSI metric is preserved verbatim in a model-level OSI-vendor custom_extension (obml_unconverted_metrics) and re-emitted on OBML to OSI, so the OSI to OBML to OSI roundtrip stays lossless. A LOSSY: warning is raised for each such metric because it is not queryable through OBML. SQL expressions in the ANSI_SQL, SNOWFLAKE, and DATABRICKS dialects are all read on import.

OSI v0.1.x inputs are accepted on read via a legacy normalization shim; output targets OSI v0.2.0.dev0.

See osi_obml_mapping_analysis.md for the full OBML <-> OSI core-spec mapping and osi_obml_ontology_mapping_analysis.md for the ontology-layer mapping and its documented gaps.

Development

uv sync          # install
uv run pytest    # run the test suite (includes a TPC-DS baseline)
uv run ruff check && uv run mypy src/osi_orionbelt

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osi_orionbelt-0.1.2.tar.gz (88.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osi_orionbelt-0.1.2-py3-none-any.whl (58.9 kB view details)

Uploaded Python 3

File details

Details for the file osi_orionbelt-0.1.2.tar.gz.

File metadata

  • Download URL: osi_orionbelt-0.1.2.tar.gz
  • Upload date:
  • Size: 88.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for osi_orionbelt-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b4e0dd15329443a739b970d12ac7b08ccb329964c5aa5842a80c171d517a659a
MD5 b3da095923dd55435a8881334329bb3f
BLAKE2b-256 a4b923b02812095f39aa99ede689dc955e9c2058deea98e03f772ac4375e0685

See more details on using hashes here.

Provenance

The following attestation bundles were made for osi_orionbelt-0.1.2.tar.gz:

Publisher: pypi-publish.yml on ralforion/orionbelt-semantic-layer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file osi_orionbelt-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: osi_orionbelt-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 58.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for osi_orionbelt-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 353a82f18cc7d6592462a61119eaea90af1775e16b00d20800b0a39aed7db633
MD5 3a1e139ffce9a5a1943ad6def3ab4b9c
BLAKE2b-256 c5563ada70e0b21e827f13b44562a4589716e4e003f2da8e1b63ed74b5eee793

See more details on using hashes here.

Provenance

The following attestation bundles were made for osi_orionbelt-0.1.2-py3-none-any.whl:

Publisher: pypi-publish.yml on ralforion/orionbelt-semantic-layer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.0

2 files

0.2.0

2 files

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

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