miscset.io.Parsable¶
- class miscset.io.Parsable[source]¶
Bases:
objectA class where slots are parsable.
Provides methods to import and export values for data slots from dictionaries.
- __init__()[source]¶
Initialize a Parsable object.
Initializes the object and calls the reset function.
Methods
__init__()Initialize a Parsable object.
get_dict()Return values of the data slots as dictionary.
get_json()“Return values of the data slots as a json string.
get_text([name, sep, private])Return a description.
get_yaml()“Return values of the data slots as a yaml string.
import_dict(obj[, add])Import a dictionary into data slots.
reset()Reset slots to default values.
- get_dict()[source]¶
Return values of the data slots as dictionary.
Same as accessing the __dict__ slot from a class instance.
- Returns
- A dictionary with keys named as the class instance slots
containing the respective values.
- Return type
- get_json()[source]¶
“Return values of the data slots as a json string.
- Returns
A JSON formatted string.
- Return type
- get_yaml()[source]¶
“Return values of the data slots as a yaml string.
- Returns
A YAML formatted string.
- Return type