skip to navigation
skip to content

redbaron 0.5.1

Abstraction on top of baron, a FST for python to make writing refactoring code a realistic task


RedBaron is a python library and tool powerful enough to be used into IPython solely that intent to make the process of writting code that modify source code as easy and as simple as possible. That include writing custom refactoring, generic refactoring, tools, IDE or directly modifying you source code into IPython with an higher and more powerful abstraction than the advanced texts modification tools that you find in advanced text editors and IDE.

RedBaron guaranteed you that it will only modify your code where you ask him to. To achieve this, it is based on Baron a lossless AST for Python that guarantees the operation ast_to_code(code_to_ast(source_code)) == source_code. (Baron’s AST is called a FST, a Full Syntax Tree).

RedBaron API and feel is heavily inspired by BeautifulSoup. It tries to be simple and intuitive and that once you’ve get the basics principles, you are good without reading the doc for 80% of your operations.

For now, RedBaron can be considered in alpha, the core is quite stable but it is not battle tested yet and is still a bit rough. Feedback is very welcome.

Disclamer: RedBaron (and baron) is working with python3 but it NOT fully parsing it yet.


pip install redbaron

Running tests

pip install pytest
py.test tests


0.5.1 (2015-03-11)

  • fix whitespace duplication when using .insert()
  • DecoratorProxyList of the last method of a function wasn’t handling correctly the indentation of its last endl token

0.5 (2015-01-31)

0.4 (2014-12-11)

  • compatibility with baron upstream (removal of def_argument_node and uniformisation of def_arguments structure)
  • fix: long wasn’t supported in redbaron (due to a bug in baron)

0.3 (2014-11-12)

  • proxy lists, major improvement in the management of list of things
  • .append_value is no more since it is useless now due to proxy lists
  • .index has been renamed to .index_on_parent to be more coherent

0.2 (2014-09-23)

0.1 (2014-06-13)

  • First release
File Type Py Version Uploaded on Size
redbaron-0.5.1-py2.7.egg (md5) Python Egg 2.7 2015-03-11 19KB
redbaron-0.5.1-py2.py3-none-any.whl (md5) Python Wheel 2.7 2015-03-11 22KB
redbaron-0.5.1.tar.gz (md5) Source 2015-03-11 20KB
  • Downloads (All Versions):
  • 62 downloads in the last day
  • 506 downloads in the last week
  • 1932 downloads in the last month