In-memory python event library
Project description
Eventipy
eventipy is an in-memory event library for python 3.6 and greater.
Getting Started
To install:
pip install eventipy
For full documentation please visit: https://eventipy.readthedocs.io/en/stable/
Usage
Publishing events:
import asyncio
from eventipy import events, Event
event = Event(topic="my-topic")
asyncio.run(events.publish(event))
Subscribing to topics:
from eventipy import events, Event
@events.subscribe("my-topic")
def event_handler(event: Event):
# Do something with event
print(event.id)
now every time an event with topic my-topic
is published, event_handler
will be called.
Define your own events like this:
class MyEvent(Event):
topic = "event-topic"
foo: int
bar: int
eventipy uses pydantic, so there is automatic type checking!
Tests
Use the package manager pip to install eventipy
pytest tests/unit
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
To bump the version we use bumpversion
to handle versions. Actions:
Bug fixes:
$ bumpversion patch # from v1.0.0 -> v1.0.1
New features:
$ bumpversion minor # from v1.0.0 -> v1.1.0
Breaking changes:
$ bumpversion major # from v1.0.0 -> v2.0.0
These commands will create a commit, if you want to avoid this please add the --no-commit
flag.
License
We use the MIT license, see LICENSE.md for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file eventipy-2.1.1.tar.gz
.
File metadata
- Download URL: eventipy-2.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.11 Linux/5.8.0-1036-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7dc3848d24309d7a349640934c2e1640942396a1aaa06260035ff71b19b6f7d |
|
MD5 | 3b0ab4b4267528d7a2e133c81251bbd8 |
|
BLAKE2b-256 | da8ca24fbaf683fc36bdea2582c29be8c77dcb99f30ad270dacbefe8fb5f6b4e |
File details
Details for the file eventipy-2.1.1-py3-none-any.whl
.
File metadata
- Download URL: eventipy-2.1.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.11 Linux/5.8.0-1036-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a72e2537d31bad9204627bc4cc0c2c78793da75c0c0782688b46490d289dea6 |
|
MD5 | 04792d4302d0f4a98ba4e30570eb63be |
|
BLAKE2b-256 | 4474062891baa80b538e6b265e1266986da742cd97d81b6b79ce4104651186df |