TOML


TOML is a file format for configuration files. It is intended to be easy to read and write due to obvious semantics which aim to be "minimal", and is designed to map unambiguously to a dictionary. Its specification is open-source, and receives community contributions. TOML is used in a number of software projects, and is implemented in many programming languages. The name "TOML" is an acronym for "Tom's Obvious, Minimal Language" referring to its creator, Tom Preston-Werner.

Syntax

TOML's syntax primarily consists of key = "value" pairs, , and # comments. TOML's syntax somewhat resembles that of.INI files, but it includes a formal specification,
whereas the INI file format suffers from many competing variants.
Its specification includes a list of supported data types: String, Integer, Float, Boolean, Datetime, Array, and Table.

Example


  1. This is a TOML document.
title = "TOML Example"
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates
server = "192.168.1.1"
ports =
connection_max = 5000
enabled = true
# Indentation is allowed but not required

ip = "10.0.0.1"
dc = "eqdc10"

ip = "10.0.0.2"
dc = "eqdc10"
data = , ]
  1. Line breaks are OK when inside arrays
hosts =
"alpha",
"omega"

Comparison to other formats

The following table draws on the to make a comparison to other popular configuration formats. [See also BespON as introduced at SciPy 2017, as well as a discussion of using TOML for parametrization of simulation modeling.
FormatFormal StandardFlexible StandardStrongly TypedEasy ImplementationHuman ReadableAllows comments
JSON
YAML
TOML
INI

Criticism

Since its first release TOML has received several critiques. The project lists the following points as problematic in TOML:
The project has since released a more extensive critique of TOML from the INI perspective, listing the following points as problematic: