Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/exegia/corpora-py/llms.txt

Use this file to discover all available pages before exploring further.

All configuration is available via the Settings class and pre-resolved constants in exegia.utils.constant. The module resolves the correct .env file at import time and exposes every value as a typed attribute — no manual os.getenv() calls needed in application code.

Importing Settings

Use settings (the module-level singleton) for the common case, or call get_settings() explicitly when you need the factory:
from exegia.utils.constant import settings, get_settings

# Module-level cached singleton
print(settings.environment)  # "development"
print(settings.supabase_url) # your project URL

# Or call the factory directly
s = get_settings()
print(s.project_ref)

Available Constants

All constants below are importable directly from exegia.utils.constant. They are resolved once at import time from the active Settings instance.
from exegia.utils.constant import (
    SUPABASE_API_URL,
    SUPABASE_PUBLISHABLE_KEY,
    SUPABASE_SECRET_KEY,
    SUPABASE_STORAGE_BUCKET,
    SUPABASE_DB_URL,
    SUPABASE_DB_PASSWORD,
    SUPABASE_DB_USER,
    SUPABASE_STORAGE_ACCESS_KEY,
    SUPABASE_STORAGE_SECRET_KEY,
    ENVIRONMENT,
    CORS_ORIGINS,
    CORS_ORIGINS_LIST,
    OPENAI_KEY,
    PROJECT_REF,
    PROJECT_ROOT,
    DEVELOPMENT_TEAM,
    APPLE_TEAM_ID,
)

Settings Class Fields

The Settings class extends pydantic_settings.BaseSettings. Fields map directly to environment variable names (field names are lowercase; env variable names are uppercase).
FieldTypeEnv VariableDefault
supabase_urlstrSUPABASE_URL""
supabase_storage_bucketstr"corpora"
supabase_publishable_keystrSUPABASE_PUBLISHABLE_KEY""
supabase_secret_keystrSUPABASE_SECRET_KEY""
project_refstrPROJECT_REF""
supabase_db_urlstrSUPABASE_DB_URL""
supabase_db_passwordstrSUPABASE_DB_PASSWORD""
supabase_db_userstrSUPABASE_DB_USER""
supabase_storage_access_keystrSUPABASE_STORAGE_ACCESS_KEY""
supabase_storage_secret_keystrSUPABASE_STORAGE_SECRET_KEY""
environmentstrENVIRONMENT"development"
cors_originsstrCORS_ORIGINS""
open_ai_keystrOPENAI_KEY""
development_teamstrDEVELOPMENT_TEAM""
apple_team_idstrAPPLE_TEAM_ID""

cors_origins_list Property

The cors_origins_list property parses the raw CORS_ORIGINS string into a Python list, stripping whitespace around each entry:
from exegia.utils.constant import settings

# If CORS_ORIGINS="https://app.example.com, https://admin.example.com"
print(settings.cors_origins_list)
# ["https://app.example.com", "https://admin.example.com"]
An empty or unset CORS_ORIGINS returns an empty list.

Local Supabase with OrbStack

When running Supabase locally using OrbStack, SUPABASE_URL is not used by the internal client. Instead, the SUPABASE_API_URL constant and database host are constructed automatically from PROJECT_REF:
  • API (Kong gateway): https://supabase_kong_{PROJECT_REF}.orb.local
  • Database host: supabase_db_{PROJECT_REF}.orb.local
  • Studio URL: supabase_studio_{PROJECT_REF}.orb.local
Set PROJECT_REF in your .env.development file to match your local Supabase container name.
get_settings() is wrapped with lru_cache(maxsize=1), so the Settings object is constructed exactly once per process. The module-level settings singleton calls get_settings() at import time. If you change environment variables after the module has been imported, the cached instance will not pick up the new values — restart the process to reload the configuration.

Build docs developers (and LLMs) love