ipyevents
A custom widget for returning mouse and keyboard events to Python
What it is and what it does
ipyevents is a Jupyter widget that bridges browser-side mouse and keyboard events to Python code running in notebook cells. It wraps any existing ipywidgets widget and emits events when users interact with it—clicking, typing, moving the mouse—allowing you to write event handlers in Python that respond to those interactions in real time.
The package is designed for interactive notebook workflows where you want to build responsive interfaces without leaving Python. Common use cases include adding keyboard shortcuts to widgets, detecting clicks on images, and building custom interactive visualizations. It depends only on ipywidgets and is compatible with modern Python versions (3.9 and above) and JupyterLab 3 or higher.
Use it for:
- Add keyboard shortcuts to existing widgets in a notebook for faster user interaction
- Detect and respond to mouse clicks on an image to trigger analysis or display metadata
- Build interactive drawing or annotation tools by capturing mouse movement and click events
- Create custom interactive plots that respond to user clicks or key presses without rebuilding the widget
- Implement event-driven callbacks for data exploration workflows in Jupyter notebooks
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ipyevents provides a Jupyter widget that captures mouse and keyboard events from the browser and returns them to Python, enabling event-driven interactions within notebook cells.
Yes. ipyevents is actively maintained, has no known vulnerabilities, installs with low friction, and fills a clear gap in Jupyter interactivity. If you need to capture and respond to browser events in a notebook widget, it is the standard tool for that task.
Install
ipyevents on PyPI
pip
pip install ipyeventsuv
uv add ipyeventspoetry
poetry add ipyeventsInstalling ipyevents
Before you install
Low friction: pure Python wheel with a single runtime dependency on ipywidgets. Actively maintained with recent commits and no known vulnerabilities.
License in practice
BSD 3-clause permissive license allows use in commercial and private projects with minimal restrictions beyond retaining the license notice.
Quickstart
pip install ipyevents
from ipyevents import Event
from ipywidgets import Image
image = Image(value=open('image.png', 'rb').read())
events = Event(source=image, watched_events=['click'])
def on_click(change):
print(f"Clicked at {change['new']}")
events.on_msg(on_click)
Requires JupyterLab 3 or higher (stable releases 2.0.0+); earlier versions support JupyterLab 2 via ipyevents 0.9.0.
Verify before relying
- Whether the package supports touch events or only mouse/keyboard events
- Performance characteristics when handling high-frequency event streams
- Compatibility with non-JupyterLab notebook environments (classic Jupyter, VS Code, etc.)
Package facts
| License | BSD 3-clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — ipywidgets |
| Maintenance | actively maintained — 333 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 557,082/month — #6,014 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ipyevents-2.0.4-py3-none-any.whl
Keywords: IPython, Jupyter, Widgets
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
ipywidgetsipywidgets provides interactive HTML widgets…
permissive · top 1,000 on PyPI
ipytreeipytree provides a tree-structure widget for…
permissive · top 15,000 on PyPI
ipylabipylab lets you control JupyterLab's interface…
permissive · top 15,000 on PyPI
jupyterlab-widgetsEnables Jupyter/IPython widgets to render and…
permissive · top 1,000 on PyPI
ipymplipympl enables interactive matplotlib plots in…
permissive · top 5,000 on PyPI
jupyter-ui-pollBlocks Jupyter cell execution while waiting for…
permissive · top 15,000 on PyPI
evdevProvides Python bindings to Linux's evdev and…
permissive · top 5,000 on PyPI
ipyleafletipyleaflet embeds interactive Leaflet maps…
permissive · top 15,000 on PyPI
sshkeyboardCaptures keyboard input via callbacks in SSH…
permissive · top 15,000 on PyPI
pyiotoolsProvides unified I/O handling for command-line,…
permissive · top 15,000 on PyPI