skillfed

pymitter

Python port of the extended Node.js EventEmitter 2 approach providing namespaces, wildcards and TTL.

pymitter v1.1.3 118.3K downloads/30d#12,124 on PyPI148
Permissive license BSD-3-Clause Active released

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 pymitter

uv

uv add pymitter

poetry

poetry add pymitter

Installing 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

Intended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming 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

event emitter pythonpublish subscribe patternevent listener registrationwildcard event matchingasync event handlingevent namespacesnodejs eventemitter port
event-drivenpub-subasync-support

More Software Development packages