app.services

Contains services that are available via fastapi dependency injection.

Module Contents

async app.services.use_leqo_db() collections.abc.AsyncGenerator[sqlalchemy.ext.asyncio.AsyncEngine]

Context manager that initializes the leqo database.

Return type:

collections.abc.AsyncGenerator[sqlalchemy.ext.asyncio.AsyncEngine]

async app.services.leqo_lifespan(_app: fastapi.FastAPI | None = None) collections.abc.AsyncGenerator[None]

Fastapi lifespan context manager. Initializes the database.

Parameters:

_app (fastapi.FastAPI | None)

Return type:

collections.abc.AsyncGenerator[None]

app.services.get_db_engine() sqlalchemy.ext.asyncio.AsyncEngine

Gets the leqo database. Only available when called during leqo_lifespan.

Return type:

sqlalchemy.ext.asyncio.AsyncEngine

app.services.get_settings() app.config.Settings

Get environment variables from pydantic and cache them.

Return type:

app.config.Settings

app.services.get_result_url(uuid: uuid.UUID, settings: Annotated[app.config.Settings, Depends(get_settings)]) str

Return the full URL for a result identified by its UUID.

Parameters:
Return type:

str