--- id: pymitter version: "1.1.3" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # pymitter — Python port of the extended Node.js EventEmitter 2 approach providing namespaces, wildcards and TTL. License: permissive · Maintenance: active · Downloads: 118.3K/mo ## 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 above — 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 pip install pymitter uv add pymitter 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_current - Install friction: low - Maintenance: active - Downloads: 118.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags event emitter python, publish subscribe pattern, event listener registration, wildcard event matching, async event handling, event namespaces, nodejs eventemitter port, event-driven, pub-sub, async-support [View on SkillFed](https://skillfed.io/packages/pymitter) · [View on PyPI](https://pypi.org/project/pymitter/)