YAMLIO¶
- class upsilonconf.io.YAMLIO(indent: int = 2, sort_keys: bool = False)[source]¶
IO for reading/writing YAML files.
Added in version 0.5.0.
- Parameters:
- indentint, optional
The number of spaces to use for indentation in the output file.
- sort_keysbool, optional
Whether keys should be sorted before writing to the output file.
- property extensions¶
Collection of extensions that are supported by this IO.
- read_from(**kwargs)¶
Read configuration from a file-like object.
- Parameters:
- streamTextIO
Readable character stream (file-like object).
- Returns:
- configdict
A dictionary representing the configuration in the stream.
- Raises:
- TypeError
If the implementation does not support reading from a stream.
- write_to(**kwargs)¶
Write configuration to a file-like object.
- Parameters:
- streamTextIO
Writeable character stream (file-like object).
- confMapping
A dictionary representing the configuration to be written.
- Raises:
- TypeError
If the implementation does not support writing to a stream.