Abstraction on top of baron, a FST for python to make writing refactoring code a realistic task
Project description
Introduction
RedBaron is a query library for the [Baron](https://github.com/Psycojoker/baron) Full Syntax Tree (FST). But what is Baron? Baron is a syntax tree, like an [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) for the Python language that hold the following rule: <code>syntax_tree_to_code(code_to_syntax_tree(code)) == code</code>. The Baron FST is in form of JSON-serializable Python (list and dict) which is very low level and not extremely funny to work with (a bit like bytecode), RedBaron is an abstraction on top of that to ease the exploration and modification of this FST.
Ok, but why this can be useful? The (hard) bet made by Baron is to induce a paradigm change in which writing code that explore or modify code (like (custom) refactoring code, refactoring browser, tooling, autoformatting…) is now a realistic task for most of the developers. Having a FST for Python means that the task of modifying source code just shift from parsing then modifying a string to modifying a meaningful tree. For a longer explanation [read this](https://redbaron.readthedocs.org/en/latest/why.html).
For now, RedBaron is in its early stages of development, it is quite stable but it is probably not the most shiny experience yet. Feedback is very welcome.
Installation
pip install redbaron
Links
[Documentation](https://redbaron.readthedocs.org)
[Baron](https://github.com/Psycojoker/baron)
IRC chat: [irc.freenode.net#baron](https://webchat.freenode.net/?channels=%23baron)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for redbaron-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 311771d1dfd822da45a6ae5f741557d8ddcfe26d3cd60e6154d9c1d910dc2ed1 |
|
MD5 | 78144576298794ea7313aedb6bd41a02 |
|
BLAKE2b-256 | 3ca57f48669b7a4142b3c450ca01fb64639a5f8a1eaf0d97d333f347ced024fa |