Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redbaron-0.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

redbaron-0.1-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2Python 3

redbaron-0.1-py2.7.egg (7.6 kB view details)

Uploaded Egg

File details

Details for the file redbaron-0.1.tar.gz.

File metadata

  • Download URL: redbaron-0.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for redbaron-0.1.tar.gz
Algorithm Hash digest
SHA256 686ddf7c7085f440c2967210ac6d5db9346a0f57944cb2f60c7148aecae5c0f1
MD5 9994659759c2e49a03313395d611f3ff
BLAKE2b-256 6a5d4b79fc7cceb795e36428545b5dd58234240b0d4f7ab01ebccad91a59c09c

See more details on using hashes here.

File details

Details for the file redbaron-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for redbaron-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 311771d1dfd822da45a6ae5f741557d8ddcfe26d3cd60e6154d9c1d910dc2ed1
MD5 78144576298794ea7313aedb6bd41a02
BLAKE2b-256 3ca57f48669b7a4142b3c450ca01fb64639a5f8a1eaf0d97d333f347ced024fa

See more details on using hashes here.

File details

Details for the file redbaron-0.1-py2.7.egg.

File metadata

  • Download URL: redbaron-0.1-py2.7.egg
  • Upload date:
  • Size: 7.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for redbaron-0.1-py2.7.egg
Algorithm Hash digest
SHA256 81b0885332550d079658508bf92e34aaa5dfa3cc30cde64eaee25bc8e8b38905
MD5 095da563d69e1ab3b430b17018649828
BLAKE2b-256 7d9a2fa163335a92bf559f5ea5b4d7831a2d1e518db129fd565d7a6f38a26cc3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page