minevent
Overview
minevent is a Python library that provides a minimal event system for Machine Learning.
It allows to customize a code by adding some piece of code that are executed when an event is
fired.
minevent is organized around three main concepts:
- event which defines the thing that should happen.
- event handler which is the piece of code to execute when the event happens
- event manager which is responsible to manage the events and event handlers.
The library provides some implemented modules, but it is possible to extend it. It is possible to use all the components or just a subset based on the need. For example, an event handler can be used without the event manager.
Motivation
minevent provides a minimal event system to customize a piece of code without changing its
implementation.
Below is an example on how to use minevent library.
>>> from minevent import EventHandler, EventManager
>>> def say_something(manager: EventManager) -> None:
... print("Hello, I am Bob!")
... manager.trigger_event("after")
...
>>> manager = EventManager()
>>> say_something(manager)
Hello, I am Bob!
>>> def hello_handler() -> None:
... print("Hello!")
...
>>> manager.add_event_handler("after", EventHandler(hello_handler))
>>> say_something(manager)
Hello, I am Bob!
Hello!
It allows to customize the function say_something without changing its implementation.
Features
- Minimal and Lightweight: Only depends on
coola, keeping your project dependencies clean - Simple API: Easy to learn and use with intuitive event registration and triggering
- Conditional Handlers: Built-in support for conditional event execution (e.g., periodic execution)
- Extensible: Create custom event handlers and conditions for your specific needs
- Type Hints: Full type hint support for better IDE integration and code quality
- Well Tested: Comprehensive test suite ensuring reliability
- Well Documented: Extensive documentation with examples and best practices
Quick Links
- Documentation: https://durandtibo.github.io/minevent/
- Quickstart Guide: https://durandtibo.github.io/minevent/quickstart/
- Examples: See the
examples/directory for practical use cases - FAQ: https://durandtibo.github.io/minevent/faq/
- Best Practices: https://durandtibo.github.io/minevent/best_practices/
Installation
We highly recommend installing
a virtual environment.
minevent can be installed from pip using the following command:
pip install minevent
To make the package as slim as possible, only the minimal packages required to use minevent are
installed.
To include all the dependencies, you can use the following command:
pip install minevent[all]
Please check the get started page to see how to
install only some specific dependencies or other alternatives to install the library.
The following is the corresponding minevent versions and supported dependencies.
minevent |
coola |
python |
|---|---|---|
main |
>=1.0,<2.0 |
>=3.10 |
0.5.0 |
>=1.0,<2.0 |
>=3.10 |
0.4.0 |
>=0.10,<1.0 |
>=3.10 |
0.3.2 |
>=0.9.1,<1.0 |
>=3.10,<3.15 |
0.3.1 |
>=0.8.4,<1.0 |
>=3.9,<3.14 |
0.3.0 |
>=0.1,<1.0 |
>=3.9,<3.13 |
0.2.1 |
>=0.1,<0.3 |
>=3.9,<3.13 |
0.2.0 |
>=0.1,<0.3 |
>=3.9,<3.13 |
0.1.0 |
>=0.0.20,<0.2 |
>=3.9,<3.13 |
older versions
minevent |
coola |
python |
|---|---|---|
0.0.5 |
>=0.0.20,<0.0.24 |
>=3.9,<3.12 |
0.0.4 |
>=0.0.20,<0.0.24 |
>=3.9,<3.12 |
0.0.3 |
>=0.0.20,<0.0.24 |
>=3.9,<3.12 |
0.0.2 |
>=0.0.20,<0.0.23 |
>=3.9,<3.12 |
0.0.1 |
>=0.0.20,<0.0.23 |
>=3.9,<3.12 |
Contributing
We welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or creating examples, your help is appreciated.
How to Contribute
- Report Issues: Found a bug? Have a feature request? Open an issue on GitHub
- Submit Pull Requests: Fix bugs or add features by submitting a PR
- Improve Documentation: Help make our docs better
- Share Examples: Create examples showing how you use
minevent
Please check the instructions in CONTRIBUTING.md for detailed information.
Community and Support
- Issues: GitHub Issue Tracker
- Discussions: Use GitHub Discussions for questions and community interaction
- Security: See SECURITY.md for security policy and reporting vulnerabilities
API stability
:warning: While minevent is in development stage, no API is guaranteed to be stable from one
release to the next.
In fact, it is very likely that the API will change multiple times before a stable 1.0.0 release.
In practice, this means that upgrading minevent to a new version will possibly break any code that
was using the old version of minevent.
License
minevent is licensed under BSD 3-Clause "New" or "Revised" license available in LICENSE
file.
Metadata
Release files for minevent 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| minevent-0.5.0.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| minevent-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.9 kB
Release files / minevent-0.5.0.tar.gz
| Download URL | minevent-0.5.0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28ea79878347c74afd0795bc3d290f2e1b2672f6bbbf6a2efb6c667399a84d94
|
|
BLAKE2b-256 checksum How to use checksums |
90842fd72cc797bdf9e0911c0363961a0538fabe30ec1bd52edc7dc4efcb308d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / minevent-0.5.0-py3-none-any.whl
| Download URL | minevent-0.5.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62be3e990d7e79435cd763fa9d761b49930ee7195681fe80d551cd13994413b4
|
|
BLAKE2b-256 checksum How to use checksums |
879a0127b07bf10a4c9dc52c5fc7d953d31b8c52cdee6c6d6b894eb83b33fa46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|