Skip to main content

Python authoring API for Orion-native notebook UI outputs

Project description

orion-ui

Python library for building interactive notebook UI in Orion. Author controls in a code cell with import orion_ui as ui; Orion renders them as native notebook outputs.

This package is separate from orion-notebook (the orion CLI). Install orion-ui into the same Python environment as your notebook kernel.

Install

pip install orion-ui

Orion managed runtime

If you start Orion with orion and use its managed Jupyter environment (~/.orion/runtime/venv on macOS/Linux, %USERPROFILE%\.orion\runtime\venv on Windows), orion-ui is installed automatically. You do not need a separate install.

External kernel (conda, venv, your own Jupyter)

Install into that kernel's Python:

python -m pip install orion-ui

Then restart the notebook kernel and re-run your cells.

Quick example

Put a component tree as the last expression in a code cell:

import orion_ui as ui

ui.card(
    ui.stack(
        ui.select("model", ["gpt-4.1", "claude-sonnet"], label="Model", default_value="gpt-4.1"),
        ui.slider("temperature", label="Temperature", min=0, max=2, default_value=0.7, step=0.1),
    ),
    title="Controls",
    class_name="controls-card",
)

Read values in later cells:

model = ui.get("model")
temperature = ui.get("temperature")

DataFrame tables

Use ui.table() for interactive pandas DataFrame browsing without sending the entire DataFrame to the frontend:

import orion_ui as ui

ui.table(
    df,
    source="df",
    page_size=50,
    column_descriptions={
        "score": "Priority score from 1 to 10.",
        "status": "Current account status.",
    },
)

Table filtering, sorting, grouping, stats, and export requests run in the Python kernel. Saved table views are stored on the notebook output metadata as structured operations plus a readable pandas expression. Column descriptions, when provided, appear as info-icon tooltips in table headers.

class_name adds semantic CSS hooks for Orion UI in Notebook View and App View. Do not write CSS into notebook metadata; if a notebook needs custom styling, include it in the relevant cell source/output and scope selectors to rendered markdown/output areas. Orion also exposes JupyterLab-compatible rendered-content selectors such as .jp-MarkdownOutput, .jp-RenderedHTMLCommon, and .jp-OutputArea-output for cell-authored styles. Do not rely on arbitrary Tailwind classes generated at runtime.

Requirements

  • Python 3.8+
  • Orion (or another frontend that renders application/vnd.orion.ui+json) for interactive display

Other Jupyter frontends may show a static fallback instead of live controls.

Version coupling

Pin orion-ui to the same version as your Orion app when using managed runtimes (for example orion-ui==0.6.0). The Python output format and Orion's renderer are released together.

Links

License

Apache-2.0

Project details


Download files

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

Source Distribution

orion_ui-0.14.0.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

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

orion_ui-0.14.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file orion_ui-0.14.0.tar.gz.

File metadata

  • Download URL: orion_ui-0.14.0.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for orion_ui-0.14.0.tar.gz
Algorithm Hash digest
SHA256 c992be243d22b6f44373941e42bf8a0268e0e32b5f2021f7ead3d0c3706777d3
MD5 dfac5924fefb6631f9ec96a8f5ee7e74
BLAKE2b-256 ebb24bea684a9762f660b183ac590eb96a9f4fb7229de92ff4e672cb1d88bcec

See more details on using hashes here.

File details

Details for the file orion_ui-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: orion_ui-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for orion_ui-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc8a2661d865d2412009788b93d00b7971ee295fed587b0c774e6e2aa463df63
MD5 2fbdb36cf4e34ca5ede99b3c9c00374a
BLAKE2b-256 6362b81d2e921245c42974686fb338edc03400f82e91eec4cbb8299790bf9229

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page