Event Pub/Sub Library
A simple and flexible asynchronous Event Pub/Sub library for Python.
🚀 Installation
Install via pip:
pip install event-pubsub
Or install locally for development:
pip install -e .
📦 Usage
1. Subscribe to an event
from event_pubsub import subscriber
@subscriber.subscribe(event_type="hello")
def event_handler(name: str):
print(f'hello {name} from sync')
2. publish an event
from event_pubsub import publisher
async def say_hello(name: str):
await publisher.publish('hello', name)
return {"message": "success"}
3. Passing multiple arguments
from event_pubsub import subscriber
@subscriber.subscribe(event_type="hello")
async def handle_message(user_id: int, message: str):
print(user_id, message)
4. Multiple handlers
from event_pubsub import subscriber
@subscriber.subscribe("event")
async def handler1(data):
print("handler1", data)
@subscriber.subscribe("event")
async def handler2(data):
print("handler2", data)
⚙️ Configuration
Event Types
Events are identified by string keys:
"user_created"
"order_completed"
"message_received"
Argument Passing
The emit method supports flexible arguments:
from event_pubsub import publisher
await publisher.publish("event", 1, 2, 3)
📄 License
MIT License
Metadata
Release files for event-pubsub 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 | Provenance | Actions |
|---|---|---|---|---|
| event_pubsub-0.0.2.tar.gz | 4.5 kB | With provenance | Details for event_pubsub-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| event_pubsub-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for event_pubsub-0.0.2-py3-none-any.whl |
Total release size: 9.1 kB
Release files / event_pubsub-0.0.2.tar.gz
| Download URL | event_pubsub-0.0.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59a778ad64cf40d9328b9770570c05000fbf640d1900085c25189d60c5863a40
|
|
BLAKE2b-256 checksum How to use checksums |
42256efcc22a27baa8fc1864323c186534b8ce1791957eced48a86411e732861
|
| 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 Mar 29, 2026.
Transparency logRelease files / event_pubsub-0.0.2-py3-none-any.whl
| Download URL | event_pubsub-0.0.2-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
552dbbd61ac8afb0ebc8728bcd4e24b2d9a0949e7fd0068d442d5dff1d3a599e
|
|
BLAKE2b-256 checksum How to use checksums |
bcb38a869873b19349a1388ffa996fe52f4953bfbdd8cf700d6799823dc4f15d
|
| 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 Mar 29, 2026.
Transparency logSecurity for event-pubsub 0.0.2
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for event_pubsub-0.0.2.tar.gz
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 Mar 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.