pymonome is a pure Python library for easy interaction with the monome family <https://monome.org> of devices. It supports grid and arc controllers (via serialosc) and provides additional facilities for developing grid- and arc-based applications.
Installation
pymonome requires at least Python 3.6. It can be installed using pip:
pip3 install pymonome
Or use the --user option to install pymonome to the current user library directory:
pip3 install --user pymonome
Basic usage
pymonome does not communicate with any of the devices directly. Like many monome applications, it relies on serialosc for device detection and hardware input and output. As serialosc provides OSC (UDP) ports for all the devices connected to the host system, it is possible to connect to a grid via a known UDP port as follows:
import monome
GRID_HOST = '127.0.0.1'
GRID_PORT = 16816
grid = monome.Grid()
await grid.connect(GRID_HOST, GRID_PORT)
grid.led_set(0, 0, 1)
Alternatively, it is possible to instantiate the protocol class using the loop.create_datagram_endpoint() event loop method:
transport, grid = await loop.create_datagram_endpoint(monome.Grid,
remote_addr=(GRID_HOST, GRID_PORT))
Service discovery API
In practice UDP ports will be randomly assigned to devices as they are connected to the host computer. serialosc has a discovery and notification mechanism to notify clients about connected devices. It’s possible to connect to the discovery service from pymonome too:
grid = monome.Grid()
def serialosc_device_added(id, type, port):
print('connecting to {} ({})'.format(id, type))
asyncio.create_task(grid.connect('127.0.0.1', port))
serialosc = monome.SerialOsc()
serialosc.device_added_event.add_handler(serialosc_device_added)
await serialosc.connect()
Application classes
For extra convenience pymonome provides base classes for developing grid and arc-based apps, apps on grid sections, or pages on the same grid. Application base classes provide handler stubs for input events and member properties for accessing controllers.
import asyncio
import monome
class HelloApp(monome.GridApp):
def on_grid_key(self, x, y, s):
self.grid.led_set(x, y, s)
async def main():
loop = asyncio.get_running_loop()
hello_app = HelloApp()
def serialosc_device_added(id, type, port):
print('connecting to {} ({})'.format(id, type))
asyncio.create_task(hello_app.grid.connect('127.0.0.1', port))
serialosc = monome.SerialOsc()
serialosc.device_added_event.add_handler(serialosc_device_added)
await serialosc.connect()
await loop.create_future() # run forever
if __name__ == '__main__':
asyncio.run(main())
In this example, HelloApp application instance will be connected to the latest discovered grid and pressing a button will light the corresponding LED.
More examples
For more examples see the examples/ directory.
License
Copyright (c) 2011-2021 Artem Popov <artfwo@gmail.com>
pymonome is licensed under the MIT license, please see LICENSE file for details.
Metadata
Release files for pymonome 0.12.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pymonome-0.12.1.tar.gz | 11.7 kB | With provenance | Details |
Release files / pymonome-0.12.1.tar.gz
| Download URL | pymonome-0.12.1.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b9d40f118bd6aa8e22e8cbc4771ce39a0b1d9bbd0ebcae66f99e80d3b9a93cd
|
|
BLAKE2b-256 checksum How to use checksums |
301dde673c0489940f08064e63d44ed4f5f8ccd028f17df2a1ab6eb61c4bb4e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.
Transparency logSecurity for pymonome 0.12.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 1 file in this release has been uploaded with provenance metadata.
Attestation for pymonome-0.12.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.