Application configuration.
AppConfig is a frozen dataclass — immutable after creation, IDE-autocompletable, no string-key dict lookups.
config
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Read the first present integer env var from keys.
Read allowed hosts, with Railway healthcheck support when detectable.
Read TRUSTED_PROXIES as a comma/space-separated tuple (empty default).
Unlike _env_allowed_hosts, an unset value stays () so pounce ignores X-Forwarded-For entirely — there is no…
Read log format from env; invalid values fall back to default.
Read log level from env; invalid values fall back to default.
Compute Levenshtein distance between two strings.
Emit warnings for unrecognized env vars with the given prefix.
Application configuration. Immutable after creation.
All fields have sensible defaults. Override what you need::
config = AppConfig(debug=True, port=3000, secret_key="s3cr3t")
_env_int_first
function
def _env_int_first(keys: tuple[str, ...], default: int) -> int
Read the first present integer env var from keys.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
keys
|
tuple[str, ...]
|
— | |
default
|
int
|
— |
_env_allowed_hosts
function
def _env_allowed_hosts(prefix: str) -> tuple[str, ...]
Read allowed hosts, with Railway healthcheck support when detectable.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
prefix
|
str
|
— |
_env_trusted_proxies
function
def _env_trusted_proxies(prefix: str) -> tuple[str, ...]
Read TRUSTED_PROXIES as a comma/space-separated tuple (empty default).
Unlike _env_allowed_hosts, an unset value stays () so pounce ignores X-Forwarded-For entirely — there is no implicit '*' fallback.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
prefix
|
str
|
— |
_env_log_format
function
def _env_log_format(key: str, default: str) -> str
Read log format from env; invalid values fall back to default.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
key
|
str
|
— | |
default
|
str
|
— |
_env_log_level
function
def _env_log_level(key: str, default: str) -> str
Read log level from env; invalid values fall back to default.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
key
|
str
|
— | |
default
|
str
|
— |
_levenshtein
function
def _levenshtein(a: str, b: str) -> int
Compute Levenshtein distance between two strings.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
a
|
str
|
— | |
b
|
str
|
— |
_warn_unknown_env_vars
function
def _warn_unknown_env_vars(prefix: str, known_suffixes: frozenset[str]) -> None
Emit warnings for unrecognized env vars with the given prefix.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
prefix
|
str
|
— | |
known_suffixes
|
frozenset[str]
|
— |
AppConfig
class
Application configuration. Immutable after creation.
All fields have sensible defaults. Override what you need::
config = AppConfig(debug=True, port=3000, secret_key="s3cr3t")
View source · /home/runner/work/chirp/chirp/site/../src/chirp/config.py:1