ontocast.config.env_names¶
Environment-variable names of the settings fields.
Every leaf field of :class:~ontocast.config.settings.Config is read from the
environment by the BaseSettings group that declares it. The name is the
group's env_prefix plus the field name, upper-cased, unless the field
declares a validation_alias: those names bypass the prefix.
Classes¶
SettingsField
¶
Bases: BaseModel
One leaf settings field and the environment names it is read from.
Source code in ontocast/config/env_names.py
Attributes¶
env_name
property
¶
The primary environment name: the first alias, or prefix + name.
env_names
instance-attribute
¶
group
instance-attribute
¶
info
instance-attribute
¶
model_config = ConfigDict(arbitrary_types_allowed=True, frozen=True)
class-attribute
instance-attribute
¶
name
instance-attribute
¶
Functions:¶
env_names(group, field_name)
¶
Return every environment name a settings field is read from.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
type[BaseSettings]
|
The |
required |
field_name
|
str
|
The Python name of the field. |
required |
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
The names in precedence order, upper-cased. |
Source code in ontocast/config/env_names.py
iter_settings_fields(root)
¶
Yield every leaf field under root, depth first in declaration order.
A field whose type is itself a BaseSettings group is descended into
rather than yielded.