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(root, parent, key, yamlNode)[source]
Inheritance
- Parameters:
root (Configuration)
parent (Dictionary | Sequence)
yamlNode (CommentedMap | CommentedSeq)
- __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
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- _parent: Dictionary
Reference to a parent node.
- _root: Configuration
Reference to the root node.
- class pyTooling.Configuration.YAML.Dictionary(root, parent, key, yamlNode)[source]
A dictionary node in a YAML data file.
Inheritance
- Parameters:
root (Configuration)
parent (Dictionary | Sequence)
yamlNode (CommentedMap)
- __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
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- _parent: Dictionary
Reference to a parent node.
- _root: Configuration
Reference to the root node.
- class pyTooling.Configuration.YAML.Sequence(root, parent, key, yamlNode)[source]
A sequence node (ordered list) in a YAML data file.
Inheritance
- Parameters:
root (Configuration)
parent (Dictionary | Sequence)
yamlNode (CommentedSeq)
- __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
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- _parent: Dictionary
Reference to a parent node.
- _root: Configuration
Reference to the root node.
- class pyTooling.Configuration.YAML.Configuration(configFile)[source]
A configuration read from a YAML file.
Inheritance
- Parameters:
configFile (Path)
- DICT_TYPE
alias of
Dictionary
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- _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