config¶
Module-global configuration models
- pydantic settings mio.models.config.Config¶
Runtime configuration for mio.
See https://docs.pydantic.dev/latest/concepts/pydantic_settings/
Set values either in an
.envfile or using environment variables prefixed withMIO_*. Values in nested models are separated with__, eg.MIO_LOGS__LEVELSee
.env.examplein repository rootPaths are set relative to
user_dirby default, unless explicitly specified.Show JSON schema
{ "title": "Config", "description": "Runtime configuration for mio.\n\nSee https://docs.pydantic.dev/latest/concepts/pydantic_settings/\n\nSet values either in an ``.env`` file or using environment variables\nprefixed with ``MIO_*``. Values in nested models are separated with ``__`` ,\neg. ``MIO_LOGS__LEVEL``\n\nSee ``.env.example`` in repository root\n\nPaths are set relative to ``user_dir`` by default, unless explicitly specified.", "type": "object", "properties": { "user_dir": { "default": "/home/docs/.config/mio", "description": "Base directory to store user configuration and other temporary files, other paths are relative to this by default", "format": "path", "title": "User Dir", "type": "string" }, "config_dir": { "default": "config", "description": "Location to store user configs", "format": "path", "title": "Config Dir", "type": "string" }, "log_dir": { "default": "logs", "description": "Location to store logs", "format": "path", "title": "Log Dir", "type": "string" }, "logs": { "$ref": "#/$defs/LogConfig", "default": { "level": "INFO", "level_file": null, "level_stdout": null, "file_n": 5, "file_size": 4194304 }, "description": "Additional settings for logs" } }, "$defs": { "LogConfig": { "description": "Configuration for logging", "properties": { "level": { "default": "INFO", "enum": [ "DEBUG", "INFO", "WARNING", "ERROR" ], "title": "Level", "type": "string" }, "level_file": { "anyOf": [ { "enum": [ "DEBUG", "INFO", "WARNING", "ERROR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Level File" }, "level_stdout": { "anyOf": [ { "enum": [ "DEBUG", "INFO", "WARNING", "ERROR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Level Stdout" }, "file_n": { "default": 5, "title": "File N", "type": "integer" }, "file_size": { "default": 4194304, "title": "File Size", "type": "integer" } }, "title": "LogConfig", "type": "object" } } }
- Config:
extra: str = ignore
env_prefix: str = mio_
nested_model_default_partial_update: bool = True
env_file: str = .env
env_nested_delimiter: str = __
yaml_file: str = mio_config.yaml
pyproject_toml_table_header: tuple = (‘tool’, ‘mio’, ‘config’)
- Fields:
- Validators:
paths_relative_to_basedir»all fields
- field logs: LogConfig = LogConfig(level='INFO', level_file=None, level_stdout=None, file_n=5, file_size=4194304)¶
Additional settings for logs
- Validated by:
- field user_dir: Path = PosixPath('/home/docs/.config/mio')¶
Base directory to store user configuration and other temporary files, other paths are relative to this by default
- Validated by:
- validator paths_relative_to_basedir » all fields¶
If relative paths are given, make them absolute relative to
user_dir
- pydantic model mio.models.config.LogConfig¶
Configuration for logging
Show JSON schema
{ "title": "LogConfig", "description": "Configuration for logging", "type": "object", "properties": { "level": { "default": "INFO", "enum": [ "DEBUG", "INFO", "WARNING", "ERROR" ], "title": "Level", "type": "string" }, "level_file": { "anyOf": [ { "enum": [ "DEBUG", "INFO", "WARNING", "ERROR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Level File" }, "level_stdout": { "anyOf": [ { "enum": [ "DEBUG", "INFO", "WARNING", "ERROR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Level Stdout" }, "file_n": { "default": 5, "title": "File N", "type": "integer" }, "file_size": { "default": 4194304, "title": "File Size", "type": "integer" } } }
- Fields:
- Validators:
- field level: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR'] = 'INFO'¶
Severity of log messages to process.
- Validated by:
- field level_file: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR'] | None = None¶
Severity for file-based logging. If unset, use
level- Validated by:
- field level_stdout: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR'] | None = None¶
Severity for stream-based logging. If unset, use
level- Validated by:
- validator uppercase_levels » level_stdout, level, level_file¶
Ensure log level strings are uppercased