delegate-events: Python implementation of the Event Pattern.
delegate-events provides a basic implementation of the well-known Event or Pub/Sub Pattern, and is built on top of the delegate-pattern package which handles the delegation part.
Example
from delegate.pattern import delegate
from delegate.events import Channel, Event
class OnSomethingEvent(Event):
def __init__(self, what: str, why: str):
self.what = what
self.why = why
def __str__(self):
return f"{self.what} happened because of {self.why}"
class Class1:
on_something = delegate(Channel[OnSomethingEvent])
inst = Class1()
msg_queue: list[Event] = []
def fn(publisher, event: OnSomethingEvent):
msg_queue.append(event)
inst.on_something.subscribe(fn)
inst.on_something.fire(OnSomethingEvent("Something", "some other thing"))
str(msg_queue[0]) # => "Something happened because of some other thing"
Full documentation
Metadata
Release files for delegate-events 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| delegate_events-0.0.2.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| delegate_events-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / delegate_events-0.0.2.tar.gz
| Download URL | delegate_events-0.0.2.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c776c884276039de8b488eae7f76dfc6b94258781029dc41aaf580d0d584820
|
|
BLAKE2b-256 checksum How to use checksums |
b66fe876f43710a2c9b0dfaebf8f58f2cd57a716f8edb5072d77f3cf9e0bc8cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2025.
Transparency logRelease files / delegate_events-0.0.2-py3-none-any.whl
| Download URL | delegate_events-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4618d053197ecbdf65d039222bb1b7d29e35bd42b86bace14cf6feda0356a72b
|
|
BLAKE2b-256 checksum How to use checksums |
7fc8acb242bd7ab86973d9e5824c5fc609f1e0aa604b19f69415dc9c00c0498f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2025.
Transparency log