Framework adapters and server utilities for integrating EEP into existing Python services.
Project description
eep-middleware-python
Python middleware for integrating EEP into FastAPI, Flask, or Django: framework-agnostic EEPServer, auth/DB/event-bus adapters, and router helpers.
Install
From the EEP monorepo:
cd EEP/packages/eep-middleware-python
pip install -e .
Or add as a path dependency in pyproject.toml:
[tool.uv.sources]
eep-middleware-python = { path = "../eep-middleware-python", editable = true }
[project.dependencies]
eep-middleware-python = "*"
Requires Python 3.10+ (see pyproject.toml).
Quickstart (FastAPI)
import os
from fastapi import FastAPI
from eep_middleware import EEPServer
from eep_middleware.fastapi import create_eep_router
app = FastAPI()
server = EEPServer(
base_url=os.environ.get("EEP_BASE_URL", "https://api.example.com"),
did=os.environ.get("EEP_DID", "did:web:example.com"),
)
router = create_eep_router(server)
app.include_router(router, prefix="")
Adjust base_url / did to match your deployment and eep-setup.json identity.
Quickstart (Flask)
import os
from flask import Flask
from eep_middleware import EEPServer
from eep_middleware.flask import create_eep_blueprint
app = Flask(__name__)
server = EEPServer(
base_url=os.environ.get("EEP_BASE_URL", "https://api.example.com"),
did=os.environ.get("EEP_DID", "did:web:example.com"),
)
app.register_blueprint(create_eep_blueprint(server))
Django
Use get_eep_urlpatterns(server) from eep_middleware.django and include them in your URLconf (see package source for signature).
Adapters
- Auth:
JWTAuthAdapter,APIKeyAuthAdapter - DB:
InMemoryDBAdapter,PostgresDBAdapter - Event bus:
InMemoryEventBusAdapter,RedisEventBusAdapter
After setup-cli
See integrate-eep-after-setup-cli.md for aligning generated eep-generated/ artifacts with runtime options.
Test
pytest
License: Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eep_middleware-0.1.0.tar.gz.
File metadata
- Download URL: eep_middleware-0.1.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bcac1e3d6b36cc6dc11457f65c611056c492f1b627f8f574f080804c7dab444
|
|
| MD5 |
be93a7fb0ef304872bf552a4409bcaab
|
|
| BLAKE2b-256 |
39038e892add51a7b9cb2def021a6830fae3db2bad4ef647606dd7949f4e7d9a
|
Provenance
The following attestation bundles were made for eep_middleware-0.1.0.tar.gz:
Publisher:
publish.yml on eep-dev/EEP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eep_middleware-0.1.0.tar.gz -
Subject digest:
6bcac1e3d6b36cc6dc11457f65c611056c492f1b627f8f574f080804c7dab444 - Sigstore transparency entry: 1575962907
- Sigstore integration time:
-
Permalink:
eep-dev/EEP@6bf34ee388dafc7fe8565433ea6c62f409ea98ce -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/eep-dev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6bf34ee388dafc7fe8565433ea6c62f409ea98ce -
Trigger Event:
push
-
Statement type:
File details
Details for the file eep_middleware-0.1.0-py3-none-any.whl.
File metadata
- Download URL: eep_middleware-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93afce009479c915cbf86ba42850b43a748dd46ea885828f1c6bc9d54321030a
|
|
| MD5 |
67c7b8a8e2a44dfa1e59bd1494163c35
|
|
| BLAKE2b-256 |
354e3365a68a93129f1c0abe122ae4262cd1b7bf2ff684028cfad30b1d05c6c7
|
Provenance
The following attestation bundles were made for eep_middleware-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on eep-dev/EEP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eep_middleware-0.1.0-py3-none-any.whl -
Subject digest:
93afce009479c915cbf86ba42850b43a748dd46ea885828f1c6bc9d54321030a - Sigstore transparency entry: 1575962956
- Sigstore integration time:
-
Permalink:
eep-dev/EEP@6bf34ee388dafc7fe8565433ea6c62f409ea98ce -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/eep-dev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6bf34ee388dafc7fe8565433ea6c62f409ea98ce -
Trigger Event:
push
-
Statement type: