Registry / communication / rel
library0.4.9.26pypypi✓ verified 87d ago

Rel is a lightweight (0.4.9.26) event/observer pattern library for Python that implements the standard pyevent interface without external dependencies. It provides a simple publish-subscribe mechanism with event registration, firing, and listener management. The library is API-stable with infrequent releases.

pip install rel
INSTALL
IMPORT
SIG · REL
R
rel
communicationpythonv0.4.9.26
Install
1.6s avg
Import
46ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.9.26 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.046s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.046s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rel
import rel
Direct import of the package.
EventHandler
from rel import EventHandler
from rel.event import EventHandler
EventHandler is a top-level module, not a sub-package.
add
from rel import add
add is a top-level function to register listeners.
fire
from rel import fire
fire is a top-level function to trigger events.

Basic usage: add listeners, fire events synchronously or with a delay.

import rel # Register an event listener def my_handler(data): print(f"Received: {data}") rel.add('my_event', my_handler) # Fire an event rel.fire('my_event', {'key': 'value'}) # Remove listener rel.remove('my_event', my_handler) # Fire event after 1 second rel.fire_in(1.0, 'my_event', 'hello')
Debug
Known issues
gotchaThe library is single-threaded by default. Do not assume thread safety; use rel's own async/schedule features for concurrent patterns.
fix
Use rel.timeout or rel.schedule for timed callbacks, not threading.Thread.
affects: all
gotchaEventHandler is deprecated; use the module-level functions (add, fire, remove) instead.
fix
Replace EventHandler instances with rel.add() and rel.fire(). Visit documentation for migration.
affects: 0.4.x
gotchaWhen using rel.fire_in() or rel.schedule(), the program will exit immediately unless rel.dispatch() is running. These methods schedule on an internal timer that only fires while dispatch() is active.
fix
Call rel.dispatch() (blocking) to start the event loop after scheduling. Use a non-blocking alternative like rel.timeout if you need async in a GUI framework.
affects: all
Errors
Common errors & fixes
AttributeError: module 'rel' has no attribute 'event'
Attempting to import from rel.event which does not exist as a submodule.
fix
Use: from rel import EventHandler (or simply import rel and use rel.add/fire).
NameError: name 'add' is not defined
Importing incorrectly: from rel import * does not export add due to __all__ not defined.
fix
Use: from rel import add (or import rel and then rel.add).
Upgrade
Version history
0.4.9.26latest on PyPI · released Apr 26, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
rel — pip install rel · libregistry