generators ¶
Configuration generators package.
This package provides custom generators for pydantic-settings-export to generate configuration files in various formats.
Modules:
-
base–Shared utilities for configuration generators.
-
json–JSON configuration file generator.
-
toml–TOML configuration file generator.
-
yaml–YAML configuration file generator.
Classes:
-
JsonGenerator–Generate JSON configuration files.
-
JsonGeneratorSettings–Configuration for JSON generator.
-
TomlGenerator–Generate TOML configuration files.
-
TomlGeneratorSettings–Configuration for TOML generator.
-
YamlGenerator–Generate YAML configuration files.
-
YamlGeneratorSettings–Configuration for YAML generator.
Functions:
-
camel_to_snake–Convert CamelCase to snake_case.
Classes¶
JsonGenerator ¶
Bases: AbstractGenerator
Generate JSON configuration files.
Methods:
-
generate_single–Generate JSON format configuration.
JsonGeneratorSettings pydantic-model ¶
Bases: BaseModel
Configuration for JSON generator.
Show JSON schema:
{
"description": "Configuration for JSON generator.\n\nGenerator name: `json`.",
"properties": {
"paths": {
"description": "Output file paths",
"items": {
"format": "path",
"type": "string"
},
"title": "Paths",
"type": "array"
},
"indent": {
"default": 2,
"description": "JSON indentation spaces",
"title": "Indent",
"type": "integer"
}
},
"title": "JsonGeneratorSettings",
"type": "object"
}
Fields:
TomlGenerator ¶
Bases: AbstractGenerator
Generate TOML configuration files.
Methods:
-
generate_single–Generate TOML format configuration.
TomlGeneratorSettings pydantic-model ¶
Bases: BaseModel
Configuration for TOML generator.
Show JSON schema:
{
"description": "Configuration for TOML generator.\n\nGenerator name: `toml`.",
"properties": {
"paths": {
"description": "Output file paths",
"items": {
"format": "path",
"type": "string"
},
"title": "Paths",
"type": "array"
},
"include_comments": {
"default": true,
"description": "Include field descriptions as comments",
"title": "Include Comments",
"type": "boolean"
}
},
"title": "TomlGeneratorSettings",
"type": "object"
}
Fields:
-
paths(list[Path]) -
include_comments(bool)
YamlGenerator ¶
Bases: AbstractGenerator
Generate YAML configuration files.
Methods:
-
generate_single–Generate YAML format configuration.
YamlGeneratorSettings pydantic-model ¶
Bases: BaseModel
Configuration for YAML generator.
Show JSON schema:
{
"description": "Configuration for YAML generator.\n\nGenerator name: `yaml`.",
"properties": {
"paths": {
"description": "Output file paths",
"items": {
"format": "path",
"type": "string"
},
"title": "Paths",
"type": "array"
},
"include_comments": {
"default": true,
"description": "Include field descriptions as comments",
"title": "Include Comments",
"type": "boolean"
}
},
"title": "YamlGeneratorSettings",
"type": "object"
}
Fields:
-
paths(list[Path]) -
include_comments(bool)