poulet_py.config package#
- class Settings(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _cli_shortcuts=None, _secrets_dir=None, **values)[source]#
Bases:
BaseSettingsThis class loads configuration from environment variables and a .env file. It supports nested configuration using the env_nested_delimiter (e.g., LOG__LEVEL).
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_shortcuts': None, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': '', 'env_file_encoding': 'utf-8', 'env_ignore_empty': False, 'env_nested_delimiter': '__', 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': '', 'extra': 'ignore', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_config_section': None, 'yaml_file': None, 'yaml_file_encoding': None}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- setup_logging(logger, *, terminal_width=None, show_time=False, show_path=True, markup=True, rich_tracebacks=True, tracebacks_extra_lines=4, tracebacks_word_wrap=True, tracebacks_show_locals=True, level='warning', file=None)[source]#
Configure logging for the provided logger with optional rich formatting and file logging.
- Parameters:
logger (Logger) – The logger instance to configure.
terminal_width (int, optional) – The width of the terminal for rich console output. If None, the default width is used.
show_time (bool, optional) – Whether to show the time in the log output. Default is False.
show_path (bool, optional) – Whether to show the path in the log output. Default is True.
markup (bool, optional) – Whether to enable markup in the log output. Default is True.
rich_tracebacks (bool, optional) – Whether to enable rich tracebacks. Default is True.
tracebacks_extra_lines (int, optional) – Number of extra lines to show in tracebacks. Default is 4.
tracebacks_word_wrap (bool, optional) – Whether to enable word wrap in tracebacks. Default is True.
tracebacks_show_locals (bool, optional) – Whether to show local variables in tracebacks. Default is True.
level (int or str, optional) – The logging level to set for the logger. Default is warning.
file (str, optional) – The file to log to. If None, logs are output to the console.
- Return type:
None