baml.toml.Table

A TOML [table](https://toml.io/en/latest#table): a collection of key/value pairs.

Reference version

Signature

class baml.toml.Table

A TOML table: a collection of key/value pairs.

A parsed document is itself a Table. Nested tables — [a.b], inline { ... }, and array-of-table entries — are Table values inside items.

Source:<builtin>/baml/ns_toml/toml.bamlbytes 10772971

Fields

Static methods

Implementations

baml.Concrete for T

Source:<builtin>/baml/core.bamlbytes 747779

baml.FromJson for baml.toml.Table

Static methods

function

from_json

(j: baml.json.json) -> baml.toml.Table throws baml.json.DecodeError

Converts a JSON object to a TOML table.

Lossy: JSON null values are skipped, and datetime strings stay strings, since JSON has no datetime type to tell them apart by.

Skipping nulls rather than rejecting them is what makes this the forgiving entry point; item_from_json throws on a bare null.

Source:<builtin>/baml/ns_toml/toml.bamlbytes 17192491

baml.ToJson for baml.toml.Table

Instance methods

function

to_json

(self) -> baml.json.json throws baml.json.SerializationError

Renders the table as a JSON object.

Lossy in the same direction Item is rich: the baml.time.* arms render as strings, since JSON has no datetime type.

Source:<builtin>/baml/ns_toml/toml.bamlbytes 11261714