pyTooling.Configuration.YAML
Configuration reader for YAML files.
Hint
See high-level help for explanations and usage examples.
Classes
Node
: Abstract node in a configuration data structure.Dictionary
: A dictionary node in a YAML data file.Sequence
: A sequence node (ordered list) in a YAML data file.Configuration
: A configuration read from a YAML file.
Classes
- class pyTooling.Configuration.YAML.Node[source]
Inheritance
- __init__(root, parent, key, yamlNode)[source]
Initializes a node.
- Parameters:
root (
Configuration
) – Reference to the root node.parent (
Union
[Dictionary
,Sequence
]) – Reference to the parent node.yamlNode (CommentedMap | CommentedSeq)
- Return type:
None
- __len__()[source]
Returns the number of sub-elements.
- Return type:
- Returns:
Number of sub-elements.
- DICT_TYPE
alias of
Dictionary
- _parent: Dictionary
Reference to a parent node.
- _root: Configuration
Reference to the root node.
- class pyTooling.Configuration.YAML.Dictionary[source]
A dictionary node in a YAML data file.
Inheritance
- __init__(root, parent, key, yamlNode)[source]
Initializes a dictionary.
- Parameters:
root (
Configuration
) – Reference to the root node.parent (
Union
[Dictionary
,Sequence
]) – Reference to the parent node.yamlNode (CommentedMap)
- Return type:
None
- DICT_TYPE
alias of
Dictionary
- _parent: Dictionary
Reference to a parent node.
- _root: Configuration
Reference to the root node.
- class pyTooling.Configuration.YAML.Sequence[source]
A sequence node (ordered list) in a YAML data file.
Inheritance
- __init__(root, parent, key, yamlNode)[source]
Initializes a sequence.
- Parameters:
root (
Configuration
) – Reference to the root node.parent (
Union
[Dictionary
,Sequence
]) – Reference to the parent node.yamlNode (CommentedSeq)
- Return type:
None
- DICT_TYPE
alias of
Dictionary
- _parent: Dictionary
Reference to a parent node.
- _root: Configuration
Reference to the root node.
- class pyTooling.Configuration.YAML.Configuration[source]
A configuration read from a YAML file.
Inheritance
- DICT_TYPE
alias of
Dictionary
- _parent: Dictionary
Reference to a parent node.
- _root: Configuration
Reference to the root node.
- __init__(configFile)[source]
Initializes a configuration instance that reads a YAML file as input.
All sequence items or dictionaries key-value-pairs in the YAML file are accessible via Python’s dictionary syntax.
- Parameters:
configFile (
Path
) – Configuration file to read and parse.- Return type:
None