I/O¶
chanfig.io
¶
JsonEncoder
¶
YamlDumper
¶
Bases: SafeDumper
YAML Dumper for Config.
Source code in chanfig/io.py
YamlLoader
¶
Bases: SafeLoader
YAML Loader for Config.
Source code in chanfig/io.py
save
¶
Save FlatDict to file.
Raises:
| Type | Description |
|---|---|
ValueError
|
If save to |
TypeError
|
If save to unsupported extension. |
Alias:
save
Examples:
Source code in chanfig/io.py
toml_dumps
¶
Dump object to toml string when a writer is available.
Source code in chanfig/io.py
load
¶
Load a file into a FlatDict.
This function simply calls cls.load, by default, cls is NestedDict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
PathStr
|
The file to load. |
required |
|
The class of the file to load. Defaults to |
None
|
|
|
Any
|
The arguments to pass to |
()
|
|
Any
|
The keyword arguments to pass to |
{}
|
See Also
Examples:
| Python Console Session | |
|---|---|