tree-sitter-toml
TOML grammar for tree-sitter
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-tomluv
uv add tree-sitter-tomlpoetry
poetry add tree-sitter-tomlInstalling 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
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
tree-sitter-markdownProvides a tree-sitter grammar for parsing…
permissive · top 5,000 on PyPI
tree-sitter-xmlProvides a tree-sitter parser grammar for XML…
permissive · top 5,000 on PyPI
tree-sitter-yamlA tree-sitter parser grammar for YAML files…
permissive · top 5,000 on PyPI
tree-sitter-jsonProvides a JSON grammar parser for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-htmlProvides an HTML grammar for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-kotlinProvides a Kotlin language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-javaProvides a Java language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-goProvides a Go language grammar for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-embedded-templateProvides a tree-sitter parser for embedded…
permissive · top 5,000 on PyPI
taploTaplo is a TOML v1.0.0 toolkit that provides…
permissive · top 15,000 on PyPI