pyTooling.Configuration.JSON
Configuration reader for JSON 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 JSON data file.Sequence
: A sequence node (ordered list) in a JSON data file.Configuration
: A configuration read from a JSON file.
Classes
- class pyTooling.Configuration.JSON.Node(root, parent, key, jsonNode)[source]
Inheritance
- Parameters:
root (Configuration)
parent (Dictionary | Sequence)
- __init__(root, parent, key, jsonNode)[source]
Initializes a node.
- Parameters:
root (
Configuration
) – Reference to the root node.parent (
Union
[Dictionary
,Sequence
]) – Reference to the parent node.
- 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.JSON.Dictionary(root, parent, key, jsonNode)[source]
A dictionary node in a JSON data file.
Inheritance
- Parameters:
root (Configuration)
parent (Dictionary | Sequence)
jsonNode (Dict)
- __init__(root, parent, key, jsonNode)[source]
Initializes a dictionary.
- Parameters:
root (
Configuration
) – Reference to the root node.parent (
Union
[Dictionary
,Sequence
]) – Reference to the parent node.jsonNode (Dict)
- 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.JSON.Sequence(root, parent, key, jsonNode)[source]
A sequence node (ordered list) in a JSON data file.
Inheritance
- Parameters:
root (Configuration)
parent (Dictionary | Sequence)
jsonNode (List)
- __init__(root, parent, key, jsonNode)[source]
Initializes a sequence.
- Parameters:
root (
Configuration
) – Reference to the root node.parent (
Union
[Dictionary
,Sequence
]) – Reference to the parent node.jsonNode (List)
- 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.JSON.Configuration(configFile)[source]
A configuration read from a JSON 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 JSON file as input.
All sequence items or dictionaries key-value-pairs in the JSON file are accessible via Python’s dictionary syntax.
- Parameters:
configFile (
Path
) – Configuration file to read and parse.- Return type:
None