Evented
Async event sources that turn file changes, webhooks, emails and cron schedules into typed events.
evented gives you a small set of asyncio event sources behind one interface, and an
EventManager that runs them and passes every event to your callbacks. Events are pydantic
models with a to_prompt() method, so they can go straight into an LLM agent.
Sources are configured with pydantic models (evented_config), so they can be loaded from
YAML/JSON and validated.
Installation
pip install evented # core (config models, manager, event types)
pip install "evented[all]" # + watchfiles, fastapi/uvicorn, aioimaplib, croniter
Requires Python 3.13+. The backends of the sources are optional dependencies; the all extra
installs all of them.
Quickstart
import asyncio
from evented import EventData, EventManager
async def on_event(event: EventData) -> None:
print(f"[{event.source}] {event.to_prompt()}")
async def main() -> None:
async with EventManager(event_callbacks=[on_event]) as manager:
await manager.add_file_watch("./src", extensions=[".py", ".md"], name="src")
await manager.add_timed_event("*/5 * * * *", "Run the health check", name="cron")
@manager.track("compute")
async def compute(x: int) -> int:
return x * 2
await compute(21) # prints "[compute] 42"
await asyncio.sleep(60) # edit a file in ./src meanwhile
asyncio.run(main())
From configuration
EventConfig is a discriminated union over all config types (key: type):
import asyncio
from pydantic import TypeAdapter
from evented import EventConfig, EventSource
raw = {"type": "time", "name": "daily", "schedule": "0 9 * * 1-5", "prompt": "Morning report"}
config = TypeAdapter(EventConfig).validate_python(raw) # -> TimeEventConfig
async def main() -> None:
async with EventSource.from_config(config) as source:
async for event in source.events():
print(event.to_prompt())
asyncio.run(main())
You can also pass a list of configs to the manager: EventManager(configs=[...]).
Event sources
Config (type) |
Source | Backend | Event |
|---|---|---|---|
FileWatchConfig (file) |
FileSystemEventSource |
watchfiles | FileEventData |
WebhookConfig (webhook) |
WebhookEventSource |
FastAPI + uvicorn | WebhookEventData |
EmailConfig (email) |
EmailEventSource |
aioimaplib (IMAP) | EmailEventData |
TimeEventConfig (time) |
TimeEventSource |
croniter | TimeEventData |
Features
- One interface for every source: each source is an async context manager with an
events()async generator, so you can use it without the manager. EventManager: runs several sources at once, calls sync or async callbacks, and has shortcuts likeadd_file_watch(),add_webhook(),add_email_watch()andadd_timed_event().- Function tracking:
@manager.track()emits aFunctionResultEventDatafor each call, with arguments, duration and success/error status inmetadata. - Prompt templates:
await event.format(config)renders an event with the source's Jinjatemplate(timestamp and metadata can be turned off). - Lightweight config package:
evented_configholds only the pydantic models, so you can import it in config schemas without pulling in the runtime.
Metadata
Release files for evented 1.2.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 | Provenance | Actions |
|---|---|---|---|---|
| evented-1.2.0.tar.gz | 19.7 kB | With provenance | Details for evented-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evented-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for evented-1.2.0-py3-none-any.whl |
Total release size: 41.4 kB
Release files / evented-1.2.0.tar.gz
| Download URL | evented-1.2.0.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ae93c5a0788fc2d61b5e054e650723a9af394dbb41beabfcb9dde83fb3ad84a
|
|
BLAKE2b-256 checksum How to use checksums |
510c8085b19a7f7c2e660b44c8ac795722e384f3b1ad4cc945e81f7c20750308
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / evented-1.2.0-py3-none-any.whl
| Download URL | evented-1.2.0-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe549102e69e04177c4b1fb9f320ca7276b93666c0fd0666445f8ec45a377023
|
|
BLAKE2b-256 checksum How to use checksums |
83f5d68a272c7ee91a52014f3c27c19e54ce283614c83f6cc1c4f6dc2e3a1c6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for evented 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for evented-1.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.