ultralight-py DOCSshabbywu/ultralight-py

PYTHON × WEB × NATIVE

Build with the web.
Drive it with Python.

Python bindings for Ultralight 2.x. Bring HTML, CSS, and JavaScript to the native desktop, with application logic written in Python.

Python 3.10+ / Windows · Linux · macOS

INSTALL
python -m pip install ultralight-py
Installation →

01 / THE TOOLKIT

A window. A bridge. Your application.

Interface, logic, and data working together.

02 / YOUR FIRST APPLICATION

Start with a few lines.

Complete quick start →

One window. A call across languages.

Register a Python function, attach the API to the window's View, then load the page. JavaScript calls functions directly from the namespace.

AppCore drives the window loop. Offscreen scripts can opt into ScriptDriver.auto().

API registration and navigation restoration →
Examples run in local Python. Wheels include the engine and runtime resources, so no separate SDK download is needed.
hello.pyPYTHON
from ultralight_py import API, Application

with API("app") as api, Application() as app:

    @api.register
    def hello(name):
        return f"Hello, {name}!"

    window = app.create_window(800, 520, title="Hello, ultralight-py")
    api.attach(window.view)
    window.view.load_html("""
        <style>
          body { background: #111315; color: #edb584;
                 font: 24px system-ui; padding: 48px; }
        </style>
        <h1 id="hello"></h1>
        <script>
          document.querySelector('#hello').textContent = app.hello('world');
        </script>
    """)
    app.run()

03 / THE REFERENCE

Find the interface you need.

All APIs →

04 / BUILT WITH ULTRALIGHT-PY

See it all come together.

Explore the Showcase ↗

From bridge experiments to desktop games: see native recordings, implementation ideas, and source code.

Search docs

Enter a keyword to search APIs and guides

    ↑ ↓ Select · Enter Open · Esc Close