dom_toml


Dom’s tools for Tom’s Obvious, Minimal Language.

Functions:

dump(data, filename[, encoder])

Writes out data as TOML to the given file.

dumps(data[, encoder])

Convert data to a TOML string.

load(filename[, decoder])

Parse TOML from the given file.

loads(s[, decoder])

Parse the given string as TOML.

dump(data, filename, encoder=<class 'TomlEncoder'>)[source]

Writes out data as TOML to the given file.

Parameters
Return type

str

Returns

A string containing the TOML corresponding to data.

Changed in version 2.0.0: encoder must now be a TomlEncoder type or instance.

dumps(data, encoder=<class 'TomlEncoder'>)[source]

Convert data to a TOML string.

Parameters
Return type

str

Returns

A string containing the TOML corresponding to data.

Changed in version 2.0.0: encoder must now be a TomlEncoder type or instance.

load(filename, decoder=<class 'TomlDecoder'>)[source]

Parse TOML from the given file.

Parameters
Return type

Dict[str, Any]

Returns

A mapping containing the TOML data.

Changed in version 2.0.0: decoder must now be a TomlDecoder type or instance.

loads(s, decoder=<class 'TomlDecoder'>)[source]

Parse the given string as TOML.

Parameters
Return type

Dict[str, Any]

Returns

A mapping containing the TOML data.

Changed in version 2.0.0: decoder must now be a TomlDecoder type or instance.