dom_toml.encoder


Dom’s custom encoder for Tom’s Obvious, Minimal Language.

New in version 0.2.0.

Classes:

TomlEncoder(​[_dict, preserve])

Customised TOML encoder which wraps long lists onto multiple lines and adds a blank line before arrays of tables.

class TomlEncoder(_dict=<class 'dict'>, preserve=False)[source]

Bases: TomlEncoder

Customised TOML encoder which wraps long lists onto multiple lines and adds a blank line before arrays of tables.

Changed in version 0.2.0: Moved from __init__.py

Methods:

dump_inline_table(​section)

Preserve an inline table in its compact syntax instead of expanding into sections.

dump_list(​v)

Serialize a list to TOML.

dump_sections(​o, sup)

Serialise a dictionary into TOML sections.

dump_inline_table(section)[source]

Preserve an inline table in its compact syntax instead of expanding into sections.

Return type

str

dump_list(v)[source]

Serialize a list to TOML.

Parameters

v

Return type

str

dump_sections(o, sup)[source]

Serialise a dictionary into TOML sections.

Parameters
  • o

  • sup

Return type

Tuple[str, Mapping]