Integrations¶
edri.integrations.* is the home for first-party, opt-in integrations with
third-party libraries (an ORM, an LLM framework, …). Bundling those libraries
into core EDRI would force the dependency on every user, so they live here under
a shared contract.
The contract¶
Each integration's dependency is a setuptools extra, not a core requirement — install it explicitly, e.g.
pip install edri[sqlalchemy].import edrinever imports anything fromedri.integrations, so the optional dependency stays optional. You import the specific module yourself.If the extra is missing, importing the module raises a clear
ImportErrornaming the extra to install — not a bareModuleNotFoundError.
This mirrors how EDRI already treats the ASGI servers (uvicorn, hypercorn,
daphne): each is an extra, detected and imported only when actually used.
edri/integrationsis excluded frommypy(likeswitchandheaderkit): these modules bridge to optional, type-check-time-absent libraries and use deliberately dynamic patterns.
Available integrations¶
SQLAlchemy (edri.integrations.sqlalchemy) (
edri.integrations.sqlalchemy) — projected ORM responses, session-aware Managers and Events, strict query builders,ForeignKeyValidator, and the legacySessionJSONEncoder.Pydantic AI (edri.integrations.pydantic_ai) (
edri.integrations.pydantic_ai) — a thin bridge between Pydantic AI agents' tools and EDRI Events, including Pydantic AI capabilities.
Building your own? See Writing your own integration.