Metadata-Version: 2.3
Name: displaypad-lib
Version: 2.0.0
Summary: A library to easily interact with the Mountain Displaypad
License: MIT
Keywords: displaypad,mountain,driver,library,python,usb,hid
Author: AnnikenToGo
Author-email: anniken@annikentogo.de
Requires-Python: >=3.14
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Hardware :: Universal Serial Bus (USB) :: Human Interface Device (HID)
Requires-Dist: displaypad-driver (>=2.0.0)
Requires-Dist: pillow (>=12.1.0,<13.0.0)
Project-URL: Bug Tracker, https://github.com/AnnikenYT/oss-mountain-displaypad/issues
Project-URL: Documentation, https://github.com/annikenyt/oss-mountain-displaypad/wiki
Project-URL: Homepage, https://annikentogo.de
Project-URL: Repository, https://github.com/AnnikenYT/oss-mountain-displaypad
Description-Content-Type: text/markdown

# displaypad-lib

Python library for controlling the Mountain DisplayPad. Built on `displaypad-driver`.

For full documentation, see the [project wiki](https://github.com/AnnikenYT/oss-mountain-displaypad/wiki).

## What's included

- **`DisplayPad`** — main class. Manages pages, keys, and the update loop.
- **`Key`** (base class) — subclass and implement `render(ctx)`. Override lifecycle hooks (`on_press`, `on_release`, `on_double_press`, `on_long_press`, `on_tick`, `on_mount`) as needed.
- **Built-in key types**: `GifKey`, `IconKey`, `LabelKey`, `FramerateLimitedKey`, `LoggerKey`.
- **`Page` / `PageManager`** — named 12-key layouts with optional auto-timeout navigation.
- **`KeyContext`** — drawing context passed to `render()`, wrapping a per-key PIL canvas.

## Quick start

```python
from displaypad_lib import DisplayPad, LabelKey

pad = DisplayPad()
pad[0] = LabelKey("Hello", bg_color="navy")

try:
    while True:
        pad.update()
except KeyboardInterrupt:
    pass
finally:
    pad.disable()
```

For usage examples, see [lib_example.py](https://github.com/AnnikenYT/oss-mountain-displaypad/blob/main/examples/lib_example.py) and [clock.py](https://github.com/AnnikenYT/oss-mountain-displaypad/blob/main/examples/clock.py).

## Acknowledgments
Multi-page layout engine design, auto-timeout page transitions, and responsive async rendering were built with inspiration from [ramisotti13-eng/BaseCamp-Linux](https://github.com/ramisotti13-eng/BaseCamp-Linux).
