Skip to content

Quickstart — Python

Get a UI in under 15 minutes with zero frontend code.

1. Install

bash
# Run from the repository root
python -m pip install -e ./sdk

2. Create your first app

python
# main.py
from odevice import App, Device, Number, Boolean

app = App("Factory Demo")

pump = Device(
    id="pump-01",
    name="Main Pump",
    properties={
        "pressure": Number(unit="bar", min=0, max=10, view="gauge"),
        "temperature": Number(unit="°C"),
        "power": Boolean(writable=True),
    },
)

app.add(pump)

pump.update(pressure=6.2, temperature=42.1, power=True)

@pump.on_write("power")
async def set_power(value: bool):
    # Call YOUR backend here
    print(f"Power set to {value}")
    return value

app.run()

3. Run

bash
python main.py

You'll see:

==================================================
  ODevice Runtime: Factory Demo
  URL: http://0.0.0.0:8080
  Admin: admin / <generated-password>
==================================================

4. Open the UI

  • Web: open http://localhost:8080
  • Mobile: scan the terminal QR code with the ODevice app

5. See the magic

  1. Change a value in Python → UI updates in realtime
  2. Toggle a switch in the UI → your Python on_write callback fires

What happened

Your codeResult
Number(min=0, max=10, view="gauge")Gauge component
Number(unit="°C")Metric component
Boolean(writable=True)Switch component
@pump.on_write("power")Command handler

No React. No Vue. No Swift. No Kotlin.

Built for self-hosted IoT runtimes.