Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eep_middleware-0.1.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eep_middleware-0.1.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

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

Hashes for eep_middleware-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6bcac1e3d6b36cc6dc11457f65c611056c492f1b627f8f574f080804c7dab444
MD5 be93a7fb0ef304872bf552a4409bcaab
BLAKE2b-256 39038e892add51a7b9cb2def021a6830fae3db2bad4ef647606dd7949f4e7d9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for eep_middleware-0.1.0.tar.gz:

Publisher: publish.yml on eep-dev/EEP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for eep_middleware-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93afce009479c915cbf86ba42850b43a748dd46ea885828f1c6bc9d54321030a
MD5 67c7b8a8e2a44dfa1e59bd1494163c35
BLAKE2b-256 354e3365a68a93129f1c0abe122ae4262cd1b7bf2ff684028cfad30b1d05c6c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for eep_middleware-0.1.0-py3-none-any.whl:

Publisher: publish.yml on eep-dev/EEP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page