settings
template_python.settings ¶
Settings configuration for the template-python application.
This module provides the primary configuration structure for the application using Pydantic Settings. It aggregates configuration from multiple sources, including environment variables and CLI arguments, and exposes a unified interface for safe, typed configuration access across the codebase.
Settings ¶
Bases: BaseSettings
Configuration state for the application.
This class aggregates and prioritizes configuration from multiple sources, providing a unified state for the application. It is built on top of pydantic-settings to allow validation, default values, and type coercion.
Example: .. code-block:: python
from template_python.settings import Settings
settings = Settings(environment="production")
print(settings.project_root)
Source code in src/template_python/settings.py
model_config = SettingsConfigDict(arbitrary_types_allowed=True, extra='ignore', populate_by_name=True, validate_assignment=True, env_prefix='TEMPLATE_PYTHON__') class-attribute ¶
Pydantic config dict dictating environment prefixes and validation.
__repr__() ¶
Return a detailed string representation of the settings.
Returns:
| Type | Description |
|---|---|
str | A detailed string representation suitable for debugging. |
Source code in src/template_python/settings.py
__str__() ¶
Return a concise string representation of the settings.
Returns:
| Type | Description |
|---|---|
str | A concise, human-readable string summary of the settings. |