Skip to content

Repository files navigation

PyDevices Examples

See the portable PyDevices driver stack in action.

DocumentationPyScript galleryProduct packagesScreenshots

paint.py tiny_toasters.py
paint.py tiny_toasters.py

This repository is the examples, integration documentation, and browser gallery for the PyDevices driver ecosystem. The reusable product source lives in pydevices:

  • displaydev and audiodev provide portable display and audio interfaces.
  • events, keys, and multimer provide shared event, key, and timing primitives.
  • eventsys is an optional application traffic controller for non-LVGL apps.
  • board_configs, board_peripherals, and hardware drivers connect those interfaces to real boards and desktop/browser hosts.

Those libraries are designed to work across MicroPython, CircuitPython, and CPython on microcontrollers, Linux, Windows, Android, browsers, and notebooks. This repo demonstrates that portability; it is not the package source of truth.

Alpha quality. The organization is being prepared for its first external users, so names and APIs may still evolve.

Try it

The fastest route is the installable PyScript gallery. It runs the real examples in a browser and can be installed as a Progressive Web App. Start a standalone browser app from the pydevices-pyscript-template, or use the PWA guide to understand and customize the full gallery shell.

For a desktop clone:

git clone https://github.com/PyDevices/pydevices-examples.git
cd pydevices-examples
python3 -m venv .venv
.venv/bin/pip install --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ -r requirements.txt
cd lib
../.venv/bin/python examples/pydevices_demo.py

On Windows, use the equivalent .venv\Scripts\python.exe commands.

For MicroPython, install unprefixed MIP package names from the PyDevices micropython-lib index, then install a board package:

import mip

INDEX = "https://PyDevices.github.io/micropython-lib/mip/PyDevices"
mip.install("displaydev", index=INDEX)
mip.install("eventsys", index=INDEX)  # optional; used by these non-LVGL examples

See the pydevices install workflows and board configs for complete device setup.

Runtime ownership

Board configs describe hardware. They export neutral pieces such as display_drv, touch_read, host_read, and timer_async; they do not create an application runtime.

Non-LVGL examples in this repo opt into the optional eventsys coordinator:

from board_config import display_drv
from app_runtime import runtime

runtime.run_forever()

LVGL examples use the coordinator bundled with the LVGL binding and do not import eventsys:

from board_config import display_drv
from display_driver import runtime

runtime.run_forever()

This separation keeps hardware policy out of board configs and lets applications provide a different event loop or traffic controller when appropriate.

Package names

Python distributions on TestPyPI use the organization prefix; imports and MIP packages remain conventional and unprefixed.

TestPyPI distribution Python import / MIP name
pydevices-displaydev displaydev
pydevices-audiodev audiodev
pydevices-events events
pydevices-keys keys
pydevices-multimer multimer
pydevices-eventsys eventsys
pydevices-pygraphics pygraphics
pydevices-palettes palettes
pydevices-pdwidgets pdwidgets
pydevices-lvgl lvgl

Repository layout

Path Purpose
lib/examples/ Portable examples and complete demo applications
lib/utils/ Example helpers and third-party GUI adapters
web/pyscript/ PyScript gallery and reusable PWA shell
docs/ Integration, platform, example, and PWA documentation
tools/ Cross-runtime example and LVGL test harnesses
packages/ GitHub MIP manifests for examples and helpers

Related repositories

Development

.venv/bin/python -m unittest discover -s tests
.venv/bin/python -m pytest -s tests -q
.venv/bin/ruff check lib tests tools scripts

See AGENTS.md and tools/README.md for the cross-runtime example matrix. Contributions to reusable libraries and hardware support belong in pydevices; examples, integrations, and gallery work belong here.

License

MIT. See LICENSE.

About

Examples, integration guides, and an installable PyScript gallery for the PyDevices driver stack.

Topics

Resources

Contributing

Stars

52 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages