baron
Full Syntax Tree for python to make writing refactoring code a realist task
Decision gist · record as of 2026-08-14
No—unless you are working with a frozen Python 2 or 3.7 codebase and have no alternative. The project is abandoned (last commit 2021-12-09, 1709 days ago), and the documentation recommends RedBaron as the usable layer instead. If you need FST parsing for modern Python or active maintenance, look elsewhere; if you need it for legacy code and can accept a frozen dependency, proceed with caution.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a single dependency (rply).
- However, the project is abandoned—last release was 2021-12-09 and no commits since then.
- Use only if you need FST parsing for Python 2 through 3.7 grammar and are comfortable maintaining a frozen codebase.
License · maintenance · safety
lgplv3+ (copyleft) — Licensed under LGPLv3 (copyleft). Derivative works and modifications must be distributed under the same license; proprietary use requires careful compliance review.
last release 2021-12-09 (1709 days) · last repo commit 2021-12-09 · 304 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 414,063 downloads/mo, #6,837 on PyPI
Alternatives
Verify before relying
from baron import parse, dumps
source_code = "x = 1"
fst = parse(source_code)
reconstructed = dumps(fst)
assert reconstructed == source_code- Whether baron handles Python 3.8+ grammar (documentation states support up to 3.7)
- Current stability and bug-fix status given 1709 days since last release
- Whether RedBaron (the recommended higher-level abstraction) is actively maintained as an alternative
What it is and what it does
Baron is a Full Syntax Tree library that parses Python source code into a JSON-like structure while preserving all formatting details—comments, whitespace, and line breaks—that a standard AST discards. Unlike Python's built-in ast module, Baron guarantees that converting code to FST and back produces identical source code. The library outputs trees similar to Python AST but with modifications to be more human-intuitive, making it suitable for code transformation tasks like variable renaming, function inlining, and refactoring operations where formatting must be preserved.
The package depends only on rply and installs with low friction. However, it is no longer actively maintained—the last release was in December 2021 and the project is marked abandoned. Baron is positioned as a low-level tool; the documentation explicitly recommends using RedBaron (a higher-level abstraction built on Baron) for most use cases. Support covers Python 2 grammar and up to Python 3.7.
Use it for
- Rename variables in source files without accidentally modifying strings or comments containing the same text
- Inline functions or methods while preserving original code formatting and structure
- Extract code blocks into separate functions or modules with exact formatting preservation
- Implement custom refactoring operations not available in standard IDE tools or rope
- Analyze and transform code while maintaining exact source formatting for version control diffs
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No—unless you are working with a frozen Python 2 or 3.7 codebase and have no alternative.
The project is abandoned (last commit 2021-12-09, 1709 days ago), and the documentation recommends RedBaron as the usable layer instead. If you need FST parsing for modern Python or active maintenance, look elsewhere; if you need it for legacy code and can accept a frozen dependency, proceed with caution.
Install
baron on PyPI
Before you install
Low install friction with a single dependency (rply). However, the project is abandoned—last release was 2021-12-09 and no commits since then. Use only if you need FST parsing for Python 2 through 3.7 grammar and are comfortable maintaining a frozen codebase.
License in practice
Licensed under LGPLv3 (copyleft). Derivative works and modifications must be distributed under the same license; proprietary use requires careful compliance review.
Quickstart
from baron import parse, dumps
source_code = "x = 1"
fst = parse(source_code)
reconstructed = dumps(fst)
assert reconstructed == source_code
Verify before relying
- Whether baron handles Python 3.8+ grammar (documentation states support up to 3.7)
- Current stability and bug-fix status given 1709 days since last release
- Whether RedBaron (the recommended higher-level abstraction) is actively maintained as an alternative
Package facts
| License | lgplv3+ copyleft |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagerply |
| Maintenance | Abandoned 1,709 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 414,063 / month, #6,837 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Programming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Topic :: Software DevelopmentTopic :: Software Development :: Code GeneratorsTopic :: Software Development :: Libraries |
Evidence: baron-0.10.1-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python full syntax tree parser”
- baronBaron parses Python source code into a Full Syntax Tree (FST) that…
- tree-sitterPython bindings to the tree-sitter parsing library, enabling…
- tree-sitter-rustProvides a Rust language grammar for tree-sitter, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also asttokens · redbaron · tree-sitter-python · tree-sitter-go · google-pasta · tree-sitter-markdown · tree-sitter-json · tree-sitter-css · tree-sitter-java · tree-sitter-groovy