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 ./sdk2. 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.pyYou'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
- Change a value in Python → UI updates in realtime
- Toggle a switch in the UI → your Python
on_writecallback fires
What happened
| Your code | Result |
|---|---|
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.