Working With TOML and Python (Overview)
TOML—Tom’s Obvious Minimal Language—is a reasonably new configuration file format that the Python community has embraced over the last couple of years. TOML plays an essential part in the Python ecosystem. Many of your favorite tools rely on TOML for configuration, and you’ll use pyproject.toml
when you build and distribute your own packages.
In this video course, you’ll learn more about TOML and how you can use it. In particular, you’ll:
- Learn and understand the syntax of TOML
- Use
tomli
andtomllib
to parse TOML documents - Use
tomli_w
to write data structures as TOML - Use
tomlkit
when you need more control over your TOML files
00:00 Working with TOML and Python. TOML, Tom’s Obvious, Minimal Language is a reasonably new configuration file format that the Python community has embraced over the last few years.
00:12
TOML plays an essential part in the Python ecosystem. Many of your favorite tools rely on it, and you’ll use pyproject.toml
when you build and distribute your own packages.
00:22
In this course, you’ll learn more about TOML and how you can use it. In particular, you’ll learn and understand the syntax of TOML, learn how to parse TOML documents, use tomli-w
to write data structures as TOML and use tomlkit
when you need more control over your TOML files.
00:42
A module for parsing TOML was added to Python’s standard library in version 3.11, but if you need to work on an old version, you’ll see how to use the tomli
library for the same functionality on versions 3.7 and later. Any code you see running in the REPL will be using the bpython interpreter.
01:00
This is a replacement Python interpreter that offers a number of enhancements, including code highlighting and suggestions, but any code you see running on screen will work in the standard Python REPL, which is typically accessed by typing python
or python3
at your terminal or command-line prompt.
01:16 So now you know what’s going to be covered. Let’s get started.
Become a Member to join the conversation.