Skip to content

topmark.toml.types

topmark / toml / types

Shared TOML type aliases for TopMark TOML document handling.

These aliases model TOML-compatible in-memory structures used across parsing, validation, and serialization. They intentionally exclude None, since TOML has no null value - absent values must be omitted from tables rather than represented explicitly.

TomlScalar module-attribute

TomlScalar = str | int | float | bool

Scalar TOML value.

Represents the set of primitive values directly supported by TOML.

TomlValue module-attribute

TomlValue = (
    TomlScalar | list["TomlValue"] | dict[str, "TomlValue"]
)

Recursive TOML-compatible value.

A TOML value may be a scalar, a list of TOML values, or a nested table represented as a dictionary. None is intentionally excluded - callers must omit keys for absent values.

TomlTable module-attribute

TomlTable = dict[str, TomlValue]

TOML table representation.

Represents a mapping from string keys to TOML values, corresponding to a single TOML table ready for validation or serialization.

TomlTableMap module-attribute

TomlTableMap = dict[str, TomlTable]

Mapping of table names to TOML tables.

Used for mappings whose values are TOML tables, including grouped top-level or nested tables, where each key corresponds to a top-level table name and each value is a TOML table.