lvgl-python
PyDevices / lvgl-python

lvgl-python

CPython extension for LVGLimport lvgl, no MicroPython runtime. Binding C is generated from lvgl-bindings (generated/lvgl_python.c) and synced on push to main. Prebuilt pydevices-lvgl wheels on TestPyPI cover CPython 3.10–3.14 on Linux x86_64 and Windows x64, Android API 21 (arm64_v8a and x86_64, CPython 3.13–3.14), and a Pyodide pyemscripten wasm32 wheel.

Use it with PyDevices on the host, in CI, in the browser via micropip, or in an APK through pydevices-android-template.

TestPyPI GitHub lvgl-bindings

Install from TestPyPI

Import as lvgl; package name is pydevices-lvgl
pip install -i https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ pydevices-lvgl

python -c "import lvgl as lv; lv.init(); lv.deinit(); print('ok')"

Usage excerpt

Hello label

Display setup uses module-level functions, not methods on the display object.

import lvgl as lv

lv.init()
disp = lv.display_create(240, 240)
lv.display_set_color_format(disp, lv.COLOR_FORMAT.RGB565)
buf = lv.draw_buf_create(240, 240, lv.COLOR_FORMAT.RGB565, 0)
lv.display_set_draw_buffers(disp, buf, None)
lv.display_set_render_mode(disp, lv.DISPLAY_RENDER_MODE.PARTIAL)

scr = lv.screen_active()
label = lv.label(scr)
label.set_text("Hello")
lv.deinit()

Android wheel

Install a platform wheel when building an APK, or let the pydeviceslvgl p4a recipe fetch it.

pip install -i https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ \
  --only-binary=:all: \
  --platform android_21_arm64_v8a \
  pydevices-lvgl

Pyodide / WebAssembly

Native TestPyPI wheels do not run in Pyodide. Build a pyemscripten_2026_0 wheel with ./scripts/build_pyodide_wheel.sh; artifacts land in wheels/. See building.md.

Related