skillfed

ipyevents

A custom widget for returning mouse and keyboard events to Python

ipyevents v2.0.4 557.1K downloads/30d#6,014 on PyPI120
Permissive license BSD 3-clause Active released

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 ipyevents

uv

uv add ipyevents

poetry

poetry add ipyevents

Installing 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

Framework :: JupyterIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

jupyter widget mouse keyboard eventsbrowser events in jupyter notebooksipywidgets event handlingjupyter interactive event callbackskeyboard shortcuts jupyter widgetsclick detection jupyter imagesjupyter event listener widget
jupyter-widgetinteractive-notebookevent-handling

More Application Frameworks packages