Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

minevent

Latest version: v0.6.0a0

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
PyPI package Publisher: tdurand
0 Stars
0 Forks
1 Versions
7.8K Downloads
Python Repo language

Scan summary

minevent was last scanned on 27 Nov 2026 at version 0.6.0a0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 27 Nov 2026.
  • Findings: No rules fired in version 0.6.0a0.
  • Downloads: 7,829 downloads.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.6.0a0 LATEST 27 Nov 2026 No rules fired

No rules fired in 0.6.0a0

Findings

Findings for v0.6.0a0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.6.0a0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

minevent

Overview

minevent is a Python library that provides a minimal event system for Machine Learning. It allows you to customize code by adding pieces of code that are executed when an event is fired. minevent is organized around three main concepts:

  • event which is a case-sensitive string that names something that happens.
  • event handler which is a callable to execute when the event happens.
  • event manager (EventManager) which stores the event handlers and triggers the events.

A typical use is a training loop that triggers events such as epoch_end: logging, checkpointing or monitoring is then added by registering handlers, without changing the loop.

The library provides a built-in condition (PeriodicCondition) to control when a handler runs, and it is easy to extend: a handler is a callable and a condition is any function that returns a boolean, so there is no base class to extend. It is possible to use all the components or just a subset based on the need. For example, a handler is a plain callable, so it can be tested without the event manager.

  • Features
  • Usage
  • Documentation
  • Installation
  • Contributing
  • Community and support
  • API stability
  • License

:information_source: This page describes the main branch. Version 0.5.0 and older have a different API: see Installation.

Features

  • No dependency, standard library only
  • Plain callables as handlers, always called with the data of the trigger
  • Read-only payload: the data of a trigger is shared in an immutable Context
  • Conditions to control when a handler runs, with PeriodicCondition or any function that returns a boolean
  • Registrations that run once, are removed with their Subscription, or are scoped with a with block
  • Coroutine handlers with atrigger_event
  • Predictable dispatch: registration order, fail-fast errors with a note that names the handler, and a thread-safe registry
  • Fully typed

Usage

Add behavior to a training loop

The loop triggers events and knows nothing about the handlers. Logging and checkpointing are added by the code that calls it:

>>> from minevent import EventManager, PeriodicCondition
>>> def train(manager: EventManager, epochs: int) -> None:
...     for epoch in range(epochs):
...         loss = 1.0 / (epoch + 1)
...         manager.trigger_event("epoch_end", {"epoch": epoch, "loss": loss})
...     manager.trigger_event("training_end")
>>> manager = EventManager()
>>> _ = manager.add_event_handler(
...     "epoch_end", lambda context: print(f"epoch {context['epoch']}: loss={context['loss']}")
... )
>>> _ = manager.add_event_handler(
...     "epoch_end", lambda _: print("checkpoint"), condition=PeriodicCondition(freq=2)
... )
>>> _ = manager.add_event_handler("training_end", lambda _: print("Training ended"))
>>> train(manager, epochs=3)
epoch 0: loss=1.0
checkpoint
epoch 1: loss=0.5
epoch 2: loss=0.3333333333333333
checkpoint
Training ended
Register a handler and trigger an event
>>> from minevent import Context, EventManager
>>> manager = EventManager()
>>> @manager.on("epoch_end")
... def log_epoch(context: Context) -> None:
...     print(f"epoch {context['epoch']}, loss {context.get('loss', 'unknown')}")
>>> _ = manager.add_event_handler("epoch_end", lambda _: print("done"))
>>> manager.trigger_event("epoch_end", {"epoch": 1, "loss": 0.5})
epoch 1, loss 0.5
done

A handler is always called with the context of the trigger (see the calling rule), which holds the data given to trigger_event.

Control when a handler runs

A condition is a function of the context that returns a boolean. With once=True, a handler runs at most once:

>>> from minevent import EventManager, PeriodicCondition
>>> manager = EventManager()
>>> _ = manager.add_event_handler(
...     "epoch_end", lambda _: print("checkpoint"), condition=PeriodicCondition(freq=2)
... )
>>> _ = manager.add_event_handler("epoch_end", lambda _: print("first epoch"), once=True)
>>> _ = manager.add_event_handler(
...     "epoch_end",
...     lambda _: print("low loss"),
...     condition=lambda context: context["loss"] < 0.5,
... )
>>> for loss in [0.9, 0.6, 0.4]:
...     manager.trigger_event("epoch_end", {"loss": loss})
checkpoint
first epoch
checkpoint
low loss
Remove a handler

add_event_handler returns a Subscription. Call its remove method, or use it in a with block to scope the registration:

>>> from minevent import EventManager
>>> manager = EventManager()
>>> subscription = manager.add_event_handler("batch_end", lambda _: print("batch"))
>>> subscription.remove()
True
>>> with manager.add_event_handler("batch_end", lambda _: print("profile the batch")):
...     manager.trigger_event("batch_end")
profile the batch
>>> manager
EventManager(events={})
Look at the registrations

events lists the events that have a handler, and get_subscriptions the registrations of one, in the order they run. clear_event removes the handlers of an event, and reset all of them:

>>> from minevent import Context, EventManager
>>> def save(_: Context) -> None:
...     print("save")
>>> manager = EventManager()
>>> _ = manager.add_event_handler("epoch_end", save)
>>> _ = manager.add_event_handler("training_end", save, once=True)
>>> manager.events
['epoch_end', 'training_end']
>>> manager.get_subscriptions("training_end")
(Subscription(event='training_end', handler='save', once=True),)
>>> manager.clear_event("epoch_end")
>>> manager
EventManager(events={'training_end': 1})
>>> manager.reset()
>>> manager
EventManager(events={})
Await coroutine handlers

atrigger_event awaits the coroutine handlers, one after the other, and runs the synchronous ones:

>>> import asyncio
>>> from minevent import Context, EventManager
>>> async def upload(context: Context) -> None:
...     await asyncio.sleep(0)
...     print(f"uploaded {context['path']}")
>>> manager = EventManager()
>>> _ = manager.add_event_handler("checkpoint_saved", upload)
>>> asyncio.run(manager.atrigger_event("checkpoint_saved", {"path": "model.pt"}))
uploaded model.pt
Find which handler raised an error

An exception of a handler or a condition reaches the caller of the trigger, with a note that names what raised it. The next handlers are skipped:

>>> from minevent import Context, EventManager
>>> def log_loss(context: Context) -> None:
...     print(context["loss"])
>>> manager = EventManager()
>>> _ = manager.add_event_handler("epoch_end", log_loss)
>>> try:
...     manager.trigger_event("epoch_end", {"epoch": 1})
... except KeyError as exc:
...     print(exc.__notes__[0])
raised by log_loss while handling the event 'epoch_end'
More examples

The quickstart shows each feature, and the examples combine them, for example to:

Documentation

The documentation of the main branch has the following pages:

The documentation of the latest release is also available.

Installation

We highly recommend installing a virtual environment. minevent can be installed from pip using the following command:

pip install minevent

minevent has no dependency, so no optional dependencies or extras are required. It supports Linux and macOS: Windows is not supported.

This command installs the latest release. To use the API described on this page before it is released, install the main branch:

pip install git+https://github.com/durandtibo/minevent.git

Please check the get started page for other alternatives to install the library. The following is the corresponding minevent versions and supported Python versions. The older versions are listed on the releases page and the changes, with the migration from 0.5.0, are listed in the changelog.

minevent python
main >=3.11
0.5.0 >=3.10
0.4.0 >=3.10

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
  1. Report Issues: Found a bug? Have a feature request? Open an issue on GitHub
  2. Submit Pull Requests: Fix bugs or add features by submitting a PR
  3. Improve Documentation: Help make our docs better
  4. 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.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases minevent

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229