TOML stands for Tom’s Obvious, Minimal Language.
It’s a very simple configuration file format — similar to INI, but more structured and modern.
Example .toml file:
# Project metadata
title = "My Project" # Project title
debug = true # Enable debug mode
# Database settings
[database]
host = "localhost" # Database host
port = 5432 # Database port
# Authentication settings
[auth]
methods = ["password", "oauth"] # Allowed authentication methods
# Admin users
[[admins]]
name = "Anna" # Admin name
role = "admin" # Admin role
[[admins]]
name = "Ben"
role = "superadmin"
Key facts:
- It’s designed to be simple, readable, and unambiguous.
- It’s mainly used in Python, Rust, Go, and other ecosystems for project or tool configuration.
- It uses a structure of key-value pairs, tables, and arrays.
Notes:
pyproject.toml
replaces older setup.py
and requirements.txt
for many modern Python projects. The requirements.txt, you list them in the [tool.poetry.dependencies]
or other dependency sections in TOML format.
requirements.txt:
fastapi==0.100.0
uvicorn[standard]==0.22.0
requests>=2.28
becomes in pyproject.toml:
toml:
[tool.poetry.dependencies]
python = "^3.11"
fastapi = "0.100.0"
uvicorn = { version = "0.22.0", extras = ["standard"] }
requests = ">=2.28"
You can export a requirements.txt
from pyproject.toml
if needed (for example using poetry export
).
TOML: Tom’s Obvious Minimal Language
[Tom’s Obvious Minimal Language]