Skip to content

API Reference

Complete reference documentation for the fastapi-tenancy public API, auto-generated from docstrings.

Modules

Module Contents
TenancyManager Central orchestrator — lifecycle, tenant management, rate limiting
TenancyConfig Configuration model with all fields and validators
Domain Types Tenant, TenantConfig, AuditLog, TenantMetrics, enums, protocols
Exceptions Complete exception hierarchy
Context TenantContext, tenant_scope, FastAPI dependency functions
Dependencies make_tenant_db_dependency, make_tenant_config_dependency, make_audit_log_dependency
Middleware TenancyMiddleware — raw ASGI middleware
Isolation Providers SchemaIsolationProvider, DatabaseIsolationProvider, RLSIsolationProvider, HybridIsolationProvider
Resolution Strategies HeaderTenantResolver, SubdomainTenantResolver, PathTenantResolver, JWTTenantResolver
Tenant Stores TenantStore ABC, SQLAlchemyTenantStore, InMemoryTenantStore, RedisTenantStore
Cache TenantCache
Migrations TenantMigrationManager

Top-level imports

The most commonly used symbols are importable directly from fastapi_tenancy:

Python
from fastapi_tenancy import (
    TenancyConfig,
    TenancyManager,
    TenancyMiddleware,
    Tenant,
    TenantStatus,
    IsolationStrategy,
    ResolutionStrategy,
)