pymitter
Python port of the extended Node.js EventEmitter 2 approach providing namespaces, wildcards and TTL.
What it is and what it does
Pymitter is a Python port of Node.js EventEmitter2, providing a publish-subscribe mechanism for event-driven architectures. It lets you register handler functions (sync or async) to named events, then emit those events with arbitrary arguments to trigger all matching handlers in registration order. The library supports namespaced event names with wildcard matching (e.g., listening to "my_event.*" catches both "my_event.foo" and "my_event.bar"), time-to-live (TTL) limits on how many times a handler fires, and both decorator and callback registration styles.
The package is lightweight with minimal dependencies and works with modern Python versions. It handles async functions by running them in an event loop when needed, and provides three emission modes: synchronous emit, async-aware emit_async for use within an existing event loop, and emit_future for fire-and-forget async execution. This makes it suitable for building event-driven systems, plugin architectures, and inter-component communication patterns.
Use it for:
- Build a plugin system where components register handlers for lifecycle events and emit them at appropriate times.
- Implement a message broker or pub-sub layer for decoupling different parts of an application that need to react to state changes.
- Create a notification system where handlers listen to namespaced events like "user.login" and "order.shipped" with wildcard subscriptions.
- Coordinate async tasks in a web framework by emitting events when requests complete or background jobs reach milestones.
- Build a game engine where game objects emit events like collision and death that other systems listen to and react to.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
An event emitter library that lets you register handlers for named events, emit those events with arguments, and optionally match events using wildcards and namespace patterns.
Yes. Pymitter is a stable, actively maintained library with low install friction, no known vulnerabilities, and permissive licensing. It solves the event-emitter problem cleanly with wildcard and namespace support, async-friendly design, and a small dependency footprint. Install it if you need publish-subscribe or event-driven communication in your application.
Install
pymitter on PyPI
pip
pip install pymitteruv
uv add pymitterpoetry
poetry add pymitterInstalling pymitter
Before you install
Low install friction with a single lightweight dependency (typing-extensions). Actively maintained with recent releases; last commit on 2026-05-19 and latest release on 2025-07-11. Supports current Python versions (3.9+).
License in practice
BSD-3-Clause is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute this package freely provided you retain the license notice.
Quickstart
pip install pymitter
from pymitter import EventEmitter
ee = EventEmitter()
@ee.on("my_event")
def handler(arg):
print(f"Event fired: {arg}")
ee.emit("my_event", "hello")
Requires Python 3.9 or later.
Verify before relying
- Performance characteristics under high event volume or with many listeners per event.
- Thread safety guarantees when emitting events from multiple threads concurrently.
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 — typing-extensions |
| Maintenance | actively maintained — 399 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 118,330/month — #12,124 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymitter-1.1.3-py3-none-any.whl
Keywords: emitter, event, eventemitter, node, nodejs, wildcard
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI 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
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pyeepyee provides an EventEmitter class for Python…
permissive · top 1,000 on PyPI
pyventusPyventus is a Python library for building…
permissive · top 15,000 on PyPI
slackeventsapiReceives and parses events from Slack's Events…
permissive · top 15,000 on PyPI
jupyter-eventsJupyter Events provides an event system for…
permissive · top 1,000 on PyPI
psygnalPsygnal implements the observer pattern with a…
permissive · top 5,000 on PyPI
EventsProvides a publish-subscribe event system where…
permissive · top 1,000 on PyPI
asyncio-atexitRegisters cleanup functions to run when an…
permissive · top 15,000 on PyPI
psycogreenIntegrates psycopg2 with coroutine libraries…
permissive · top 5,000 on PyPI
Flask-SocketIOFlask-SocketIO adds real-time bidirectional…
permissive · top 5,000 on PyPI
makefunDynamically creates Python functions at runtime…
permissive · top 5,000 on PyPI