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 Full Syntax Tree (FST). But what is Baron? Baron is a syntax tree, like an AST for the Python language that hold the following rule: syntax_tree_to_code(code_to_syntax_tree(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.

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

Changelog

0.2 (unreleased)

0.1 (2014-06-13)

  • First release

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.2.tar.gz (15.6 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.2-py2.7.egg (14.8 kB view details)

Uploaded Egg

redbaron-0.2-py2-none-any.whl (17.2 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for redbaron-0.2.tar.gz
Algorithm Hash digest
SHA256 8d5e5df45dc16e1fed15383998fab2e775a9205a982893fb70c370edfc1c50e8
MD5 ddf07923cf1e758edfa2135cfa300a07
BLAKE2b-256 d563ed9b80123664dcdf5289a08246c245fbd380435d578a5fd743d799e9df90

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for redbaron-0.2-py2.7.egg
Algorithm Hash digest
SHA256 14eabf20a4e6a9bbbcb1984a30c31e5dbf8df2cee9969a3918f66fe5121703a4
MD5 331d68a15023ee9407b05ed1711832af
BLAKE2b-256 28078f448d908d4e259b661777e8c9f185814bb3fc2a76fec9855d6e5ee9a3ae

See more details on using hashes here.

File details

Details for the file redbaron-0.2-py2-none-any.whl.

File metadata

File hashes

Hashes for redbaron-0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 7c35e8774f5f08ecbc13667d8f8734a062d8f4767d5ef2f3776e2a92f2826fbc
MD5 4a12c4459a5b2a79b3a1ba5cf8e02fea
BLAKE2b-256 39532395c133b7a3031e7d5e16d10fb7384bc086c58c23e70e3a07b04bdc127c

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