minevent


Nameminevent JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/durandtibo/minevent
SummaryMinimal event system for Machine Learning
upload_time2024-01-16 00:39:42
maintainer
docs_urlNone
authorThibaut Durand
requires_python>=3.9,<3.13
licenseBSD-3-Clause
keywords event event system event handler
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # minevent

<p align="center">
    <a href="https://github.com/durandtibo/minevent/actions">
        <img alt="CI" src="https://github.com/durandtibo/minevent/workflows/CI/badge.svg">
    </a>
    <a href="https://durandtibo.github.io/minevent/">
        <img alt="Documentation" src="https://github.com/durandtibo/minevent/workflows/Documentation/badge.svg">
    </a>
    <a href="https://github.com/durandtibo/minevent/actions">
        <img alt="Nightly Tests" src="https://github.com/durandtibo/minevent/workflows/Nightly%20Tests/badge.svg">
    </a>
    <a href="https://github.com/durandtibo/minevent/actions">
        <img alt="Nightly Package Tests" src="https://github.com/durandtibo/minevent/workflows/Nightly%20Package%20Tests/badge.svg">
    </a>
    <br/>
    <a href="https://codecov.io/gh/durandtibo/minevent">
        <img alt="Codecov" src="https://codecov.io/gh/durandtibo/minevent/branch/main/graph/badge.svg">
    </a>
    <a href="https://codeclimate.com/github/durandtibo/minevent/maintainability">
        <img src="https://api.codeclimate.com/v1/badges/140297b4dc048f952298/maintainability" />
    </a>
    <a href="https://codeclimate.com/github/durandtibo/minevent/test_coverage">
        <img src="https://api.codeclimate.com/v1/badges/140297b4dc048f952298/test_coverage" />
    </a>
    <br/>
    <a href="https://github.com/psf/black">
        <img  alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg">
    </a>
    <a href="https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings">
        <img  alt="Doc style: google" src="https://img.shields.io/badge/%20style-google-3666d6.svg">
    </a>
    <a href="https://github.com/astral-sh/ruff">
        <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff" style="max-width:100%;">
    </a>
    <a href="https://github.com/guilatrova/tryceratops">
        <img  alt="Doc style: google" src="https://img.shields.io/badge/try%2Fexcept%20style-tryceratops%20%F0%9F%A6%96%E2%9C%A8-black">
    </a>
    <br/>
    <a href="https://pypi.org/project/minevent/">
        <img alt="PYPI version" src="https://img.shields.io/pypi/v/minevent">
    </a>
    <a href="https://pypi.org/project/minevent/">
        <img alt="Python" src="https://img.shields.io/pypi/pyversions/minevent.svg">
    </a>
    <a href="https://opensource.org/licenses/BSD-3-Clause">
        <img alt="BSD-3-Clause" src="https://img.shields.io/pypi/l/minevent">
    </a>
    <br/>
    <a href="https://pepy.tech/project/minevent">
        <img  alt="Downloads" src="https://static.pepy.tech/badge/minevent">
    </a>
    <a href="https://pepy.tech/project/minevent">
        <img  alt="Monthly downloads" src="https://static.pepy.tech/badge/minevent/month">
    </a>
    <br/>
</p>

## 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](#motivation)
- [Documentation](https://durandtibo.github.io/minevent/)
- [Installation](#installation)
- [Contributing](#contributing)
- [API stability](#api-stability)
- [License](#license)

## 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.

```pycon
>>> 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](https://durandtibo.github.io/minevent/quickstart/) to learn more
about the library.

## Installation

We highly recommend installing
a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).
`minevent` can be installed from pip using the following command:

```shell
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:

```shell
pip install minevent[all]
```

Please check the [get started page](https://durandtibo.github.io/minevent/get_started) 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.1,<0.3`       | `>=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` |
| `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` |

<details>
    <summary>older versions</summary>

| `minevent` | `coola`            | `python`      |
|------------|--------------------|---------------|
| `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` |

</details>

## Contributing

Please check the instructions in [CONTRIBUTING.md](.github/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](LICENSE)
file.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/durandtibo/minevent",
    "name": "minevent",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.13",
    "maintainer_email": "",
    "keywords": "event,event system,event handler",
    "author": "Thibaut Durand",
    "author_email": "durand.tibo+gh@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4c/cb/efc1c5b4b23900f194416867dc0c5f6174b070dfa92784f1afa68fffa903/minevent-0.3.0.tar.gz",
    "platform": null,
    "description": "# minevent\n\n<p align=\"center\">\n    <a href=\"https://github.com/durandtibo/minevent/actions\">\n        <img alt=\"CI\" src=\"https://github.com/durandtibo/minevent/workflows/CI/badge.svg\">\n    </a>\n    <a href=\"https://durandtibo.github.io/minevent/\">\n        <img alt=\"Documentation\" src=\"https://github.com/durandtibo/minevent/workflows/Documentation/badge.svg\">\n    </a>\n    <a href=\"https://github.com/durandtibo/minevent/actions\">\n        <img alt=\"Nightly Tests\" src=\"https://github.com/durandtibo/minevent/workflows/Nightly%20Tests/badge.svg\">\n    </a>\n    <a href=\"https://github.com/durandtibo/minevent/actions\">\n        <img alt=\"Nightly Package Tests\" src=\"https://github.com/durandtibo/minevent/workflows/Nightly%20Package%20Tests/badge.svg\">\n    </a>\n    <br/>\n    <a href=\"https://codecov.io/gh/durandtibo/minevent\">\n        <img alt=\"Codecov\" src=\"https://codecov.io/gh/durandtibo/minevent/branch/main/graph/badge.svg\">\n    </a>\n    <a href=\"https://codeclimate.com/github/durandtibo/minevent/maintainability\">\n        <img src=\"https://api.codeclimate.com/v1/badges/140297b4dc048f952298/maintainability\" />\n    </a>\n    <a href=\"https://codeclimate.com/github/durandtibo/minevent/test_coverage\">\n        <img src=\"https://api.codeclimate.com/v1/badges/140297b4dc048f952298/test_coverage\" />\n    </a>\n    <br/>\n    <a href=\"https://github.com/psf/black\">\n        <img  alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\">\n    </a>\n    <a href=\"https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings\">\n        <img  alt=\"Doc style: google\" src=\"https://img.shields.io/badge/%20style-google-3666d6.svg\">\n    </a>\n    <a href=\"https://github.com/astral-sh/ruff\">\n        <img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" alt=\"Ruff\" style=\"max-width:100%;\">\n    </a>\n    <a href=\"https://github.com/guilatrova/tryceratops\">\n        <img  alt=\"Doc style: google\" src=\"https://img.shields.io/badge/try%2Fexcept%20style-tryceratops%20%F0%9F%A6%96%E2%9C%A8-black\">\n    </a>\n    <br/>\n    <a href=\"https://pypi.org/project/minevent/\">\n        <img alt=\"PYPI version\" src=\"https://img.shields.io/pypi/v/minevent\">\n    </a>\n    <a href=\"https://pypi.org/project/minevent/\">\n        <img alt=\"Python\" src=\"https://img.shields.io/pypi/pyversions/minevent.svg\">\n    </a>\n    <a href=\"https://opensource.org/licenses/BSD-3-Clause\">\n        <img alt=\"BSD-3-Clause\" src=\"https://img.shields.io/pypi/l/minevent\">\n    </a>\n    <br/>\n    <a href=\"https://pepy.tech/project/minevent\">\n        <img  alt=\"Downloads\" src=\"https://static.pepy.tech/badge/minevent\">\n    </a>\n    <a href=\"https://pepy.tech/project/minevent\">\n        <img  alt=\"Monthly downloads\" src=\"https://static.pepy.tech/badge/minevent/month\">\n    </a>\n    <br/>\n</p>\n\n## Overview\n\n`minevent` is a Python library that provides a minimal event system for Machine Learning.\nIt allows to customize a code by adding some piece of code that are executed when an event is\nfired.\n`minevent` is organized around three main concepts:\n\n- **event** which defines the thing that should happen.\n- **event handler** which is the piece of code to execute when the event happens\n- **event manager** which is responsible to manage the events and event handlers.\n\nThe library provides some implemented modules, but it is possible to extend it.\nIt is possible to use all the components or just a subset based on the need.\nFor example, an event handler can be used without the event manager.\n\n- [Motivation](#motivation)\n- [Documentation](https://durandtibo.github.io/minevent/)\n- [Installation](#installation)\n- [Contributing](#contributing)\n- [API stability](#api-stability)\n- [License](#license)\n\n## Motivation\n\n`minevent` provides a minimal event system to customize a piece of code without changing its\nimplementation.\nBelow is an example on how to use `minevent` library.\n\n```pycon\n>>> from minevent import EventHandler, EventManager\n>>> def say_something(manager: EventManager) -> None:\n...     print(\"Hello, I am Bob!\")\n...     manager.trigger_event(\"after\")\n...\n>>> manager = EventManager()\n>>> say_something(manager)\nHello, I am Bob!\n>>> def hello_handler() -> None:\n...     print(\"Hello!\")\n...\n>>> manager.add_event_handler(\"after\", EventHandler(hello_handler))\n>>> say_something(manager)\nHello, I am Bob!\nHello!\n\n```\n\nIt allows to customize the function `say_something` without changing its implementation.\nPlease read the [quickstart page](https://durandtibo.github.io/minevent/quickstart/) to learn more\nabout the library.\n\n## Installation\n\nWe highly recommend installing\na [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).\n`minevent` can be installed from pip using the following command:\n\n```shell\npip install minevent\n```\n\nTo make the package as slim as possible, only the minimal packages required to use `minevent` are\ninstalled.\nTo include all the dependencies, you can use the following command:\n\n```shell\npip install minevent[all]\n```\n\nPlease check the [get started page](https://durandtibo.github.io/minevent/get_started) to see how to\ninstall only some specific dependencies or other alternatives to install the library.\nThe following is the corresponding `minevent` versions and supported dependencies.\n\n| `minevent` | `coola`            | `python`      |\n|------------|--------------------|---------------|\n| `main`     | `>=0.1,<0.3`       | `>=3.9,<3.13` |\n| `0.2.1`    | `>=0.1,<0.3`       | `>=3.9,<3.13` |\n| `0.2.0`    | `>=0.1,<0.3`       | `>=3.9,<3.13` |\n| `0.1.0`    | `>=0.0.20,<0.2`    | `>=3.9,<3.13` |\n| `0.0.5`    | `>=0.0.20,<0.0.24` | `>=3.9,<3.12` |\n| `0.0.4`    | `>=0.0.20,<0.0.24` | `>=3.9,<3.12` |\n\n<details>\n    <summary>older versions</summary>\n\n| `minevent` | `coola`            | `python`      |\n|------------|--------------------|---------------|\n| `0.0.3`    | `>=0.0.20,<0.0.24` | `>=3.9,<3.12` |\n| `0.0.2`    | `>=0.0.20,<0.0.23` | `>=3.9,<3.12` |\n| `0.0.1`    | `>=0.0.20,<0.0.23` | `>=3.9,<3.12` |\n\n</details>\n\n## Contributing\n\nPlease check the instructions in [CONTRIBUTING.md](.github/CONTRIBUTING.md).\n\n## API stability\n\n:warning: While `minevent` is in development stage, no API is guaranteed to be stable from one\nrelease to the next.\nIn fact, it is very likely that the API will change multiple times before a stable 1.0.0 release.\nIn practice, this means that upgrading `minevent` to a new version will possibly break any code that\nwas using the old version of `minevent`.\n\n## License\n\n`minevent` is licensed under BSD 3-Clause \"New\" or \"Revised\" license available in [LICENSE](LICENSE)\nfile.\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Minimal event system for Machine Learning",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/durandtibo/minevent",
        "Repository": "https://github.com/durandtibo/minevent"
    },
    "split_keywords": [
        "event",
        "event system",
        "event handler"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fd8da8b2ab889d27ca380fd29dcfa4533bed47b92fc3ae649287052e26822e6a",
                "md5": "a73fee04481ba4ed13c2e7b65dac201c",
                "sha256": "4b568f2d2f94e5970ec24795020007129f601c9e8bc2df40291d284b2cedc683"
            },
            "downloads": -1,
            "filename": "minevent-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a73fee04481ba4ed13c2e7b65dac201c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.13",
            "size": 9191,
            "upload_time": "2024-01-16T00:39:40",
            "upload_time_iso_8601": "2024-01-16T00:39:40.618189Z",
            "url": "https://files.pythonhosted.org/packages/fd/8d/a8b2ab889d27ca380fd29dcfa4533bed47b92fc3ae649287052e26822e6a/minevent-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ccbefc1c5b4b23900f194416867dc0c5f6174b070dfa92784f1afa68fffa903",
                "md5": "f5c5079024730de05976f798e8283481",
                "sha256": "aa954816318d90d24603457dfe47ba2d6849f3208987b17ff9b8696161f74db0"
            },
            "downloads": -1,
            "filename": "minevent-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f5c5079024730de05976f798e8283481",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.13",
            "size": 11196,
            "upload_time": "2024-01-16T00:39:42",
            "upload_time_iso_8601": "2024-01-16T00:39:42.022678Z",
            "url": "https://files.pythonhosted.org/packages/4c/cb/efc1c5b4b23900f194416867dc0c5f6174b070dfa92784f1afa68fffa903/minevent-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-16 00:39:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "durandtibo",
    "github_project": "minevent",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "minevent"
}
        
Elapsed time: 0.17816s