--- id: tomli version: "2.4.1" license: MIT license_treatment: permissive maintenance: active --- # tomli — A lil' TOML parser License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install tomli uv add tomli poetry add tomli ## Description [![Build Status](https://github.com/hukkin/tomli/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/hukkin/tomli/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush) [![codecov.io](https://codecov.io/gh/hukkin/tomli/branch/master/graph/badge.svg)](https://codecov.io/gh/hukkin/tomli) [![PyPI version](https://img.shields.io/pypi/v/tomli)](https://pypi.org/project/tomli) # Tomli > A lil' TOML parser **Table of Contents** *generated with [mdformat-toc](https://github.com/hukkin/mdformat-toc)* - [Intro](#intro) - [Installation](#installation) - [Usage](#usage) - [Parse a TOML string](#parse-a-toml-string) - [Parse a TOML file](#parse-a-toml-file) - [Handle invalid TOML](#handle-invalid-toml) - [Construct `decimal.Decimal`s from TOML floats](#construct-decimaldecimals-from-toml-floats) - [Building a `tomli`/`tomllib` compatibility layer](#building-a-tomlitomllib-compatibility-layer) - [FAQ](#faq) - [Why this parser?](#why-this-parser) - [Is comment preserving round-trip parsing supported?](#is-comment-preserving-round-trip-parsing-supported) - [Is there a `dumps`,... ## AI interpretation — verify before relying Tomli parses TOML configuration files into Python dictionaries. It provides a lightweight, pure-Python parser compatible with TOML v1.1.0 and offers a backport for Python versions before 3.11 when the standard library tomllib is unavailable. Verdict: Tomli is a reliable, minimal TOML parser with no dependencies, active maintenance, and MIT licensing. It's well-suited for configuration file parsing across Python 3.8+ and serves as a backport for users on Python versions before 3.11. No known vulnerabilities. [View on SkillFed](https://skillfed.io/packages/tomli) · [View on PyPI](https://pypi.org/project/tomli/)