Skip to main content

Evented

PyPI License Package status Monthly downloads Distribution format Wheel availability Python version Implementation Releases Github Contributors Github Forks Github Issues Github Issues Github Watchers Github Stars Github Repository size Github last commit Github release date Github language count Github commits this month Package status PyUp

Read the documentation!

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 like add_file_watch(), add_webhook(), add_email_watch() and add_timed_event().
  • Function tracking: @manager.track() emits a FunctionResultEventData for each call, with arguments, duration and success/error status in metadata.
  • Prompt templates: await event.format(config) renders an event with the source's Jinja template (timestamp and metadata can be turned off).
  • Lightweight config package: evented_config holds only the pydantic models, so you can import it in config schemas without pulling in the runtime.

Metadata

Release files for evented 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evented 1.2.1
File Size Uploaded Provenance Actions
evented-1.2.1.tar.gz 20.2 kB With provenance Details for evented-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for evented 1.2.1
File Interpreter ABI Platform Actions
evented-1.2.1-py3-none-any.whl Python 3 none any Details for evented-1.2.1-py3-none-any.whl

Total release size: 42.1 kB

Release files / evented-1.2.1.tar.gz

Download URL evented-1.2.1.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
11830bdd1ed1a181ac8cfbbbd6c26307c3a9b7c71a1db3dcd7ab2d88e8785d41
BLAKE2b-256 checksum
How to use checksums
7b1ce46fc07bc23c31cba6230d87ee2e397fb6a88e5ed385946aa49e5561b57b
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 25, 2026.

Transparency log

Release files / evented-1.2.1-py3-none-any.whl

Download URL evented-1.2.1-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
996d94f9ef3b2c4f068fab9fc9654ebcc4114f731bd9d295ac2e594814f236da
BLAKE2b-256 checksum
How to use checksums
ae10ac64847a369394606e14d1ac29374b9adb7c95c91de4315dbda402f5c42e
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 25, 2026.

Transparency log

Security for evented 1.2.1

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.

Select from 2 files

Attestation for evented-1.2.1.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 25, 2026.

Transparency log

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

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page