skillfed

tree-sitter-toml

TOML grammar for tree-sitter

tree-sitter-toml v0.7.0 2.2M downloads/30d#3,207 on PyPI17
Permissive license MIT AGING released

What it is and what it does

tree-sitter-toml is a grammar module for the tree-sitter incremental parsing framework, specifically targeting TOML (Tom's Obvious, Minimal Language) configuration files. It provides the syntax rules needed to parse TOML v1.0.0 documents into an abstract syntax tree. The package ships as precompiled wheels for multiple architectures, requiring Python 3.9+.

This is a low-level parsing component, not a standalone TOML reader. It is designed to be used alongside tree-sitter's Python bindings to enable syntax-aware analysis, transformation, or linting of TOML files. It has no runtime dependencies and is primarily useful for developers building tools that need fine-grained access to TOML structure rather than simple key-value extraction.

Use it for:

  • Build a TOML linter or formatter that needs to understand and preserve document structure
  • Implement a TOML editor with syntax highlighting and error detection via incremental parsing
  • Analyze TOML configuration files programmatically to extract or validate specific sections
  • Create refactoring tools that modify TOML files while maintaining formatting and comments

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a tree-sitter parser grammar for TOML files, enabling incremental parsing and syntax tree analysis of TOML configuration documents.

Yes, if you are building a tool that requires fine-grained TOML syntax analysis via tree-sitter. Install only if you already use or plan to use tree-sitter's Python API; this package alone does not parse TOML. The MIT license and zero security vulnerabilities are favorable. The aging maintenance status (619 days since release) is a minor concern but not a blocker given the grammar's stability and the repository's active status.

Install

tree-sitter-toml on PyPI

pip

pip install tree-sitter-toml

uv

uv add tree-sitter-toml

poetry

poetry add tree-sitter-toml

Installing tree-sitter-toml

Before you install

Medium install friction due to compiled wheels; prebuilt binaries are available for common platforms (macOS x86_64/arm64, Linux x86_64/aarch64, Windows x64/arm64), but requires Python 3.9+. Repository is aging (619 days since last release) but not archived and receives occasional updates.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.

Quickstart

pip install tree-sitter-toml

import tree_sitter_toml
# Use with tree-sitter Python bindings to parse TOML

Requires Python 3.9 or later and the tree-sitter Python bindings library to actually parse files.

Verify before relying

  • How to integrate this grammar with the tree-sitter Python API for actual parsing workflows
  • Whether this package is actively maintained or if the 619-day release gap indicates stalled development

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 619 days since the last release
Last repo commit
First released
Downloads 2,210,011/month — #3,207 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tree_sitter_toml-0.7.0-cp39-abi3-macosx_10_9_x86_64.whl; tree_sitter_toml-0.7.0-cp39-abi3-macosx_11_0_arm64.whl; tree_sitter_toml-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tree_sitter_toml-0.7.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tree_sitter_toml-0.7.0-cp39-abi3-musllinux_1_2_x86_64.whl; tree_sitter_toml-0.7.0-cp39-abi3-win_amd64.whl; tree_sitter_toml-0.7.0-cp39-abi3-win_arm64.whl

Keywords: incremental, parsing, tree-sitter, toml

Intended Audience :: DevelopersTopic :: Software Development :: CompilersTopic :: Text Processing :: LinguisticTyping :: Typed

Tags

toml parser tree-sitterincremental toml parsingtoml syntax treetoml grammar parserparse toml files programmatically
parsingtree-sittertoml

More Linguistic packages