Minimal event system for Machine Learning
Project description
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.
Please read the quickstart page to learn more
about the library.
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 |
>=0.8.4,<1.0 |
>=3.9,<3.14 |
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
Please check the instructions in CONTRIBUTING.md.
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.
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 minevent-0.3.1.tar.gz
.
File metadata
- Download URL: minevent-0.3.1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c946746cf09f191882738129c3448584dcebbf78a389782f660d94e64471b596 |
|
MD5 | 66c6097c65a93399bad2d43a1c43430d |
|
BLAKE2b-256 | 274c385268154444a138b28148de76bc9ac85504d985c6b818fe49231828081e |
File details
Details for the file minevent-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: minevent-0.3.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a881042542778c93962b7574788beb8f2fa67895769eb0546c6b2579c74311f4 |
|
MD5 | 787cdc86c5381418a3eca1d6cbe5abb6 |
|
BLAKE2b-256 | 6fe5411e2000ef7bd21b0e55171385417a7df2d5677dae758eb0e6a043cb1074 |