Skip to main content

Introduction

Build Status Latest Version Supported Python versions Development Status Wheel Status Download format License

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.

Installation

pip install redbaron

Running tests

pip install pytest
py.test tests

Changelog

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

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.5.1.tar.gz (21.5 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.5.1-py2.py3-none-any.whl (23.4 kB view details)

Uploaded Python 2Python 3

redbaron-0.5.1-py2.7.egg (19.9 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for redbaron-0.5.1.tar.gz
Algorithm Hash digest
SHA256 675d38a91dd871736cdd85f21177d404c00b6d2c08910f6fe7d96a6f891bac72
MD5 ff59e5f7d19eded5b21a153af09abfff
BLAKE2b-256 2cd066e8a25dce0ae36a4e794ec944c5a8db83598aa70e13e30ce10efae76a29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redbaron-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 be9ed50f086d84c30ca3954264b2be32b0846775bef777f1a72af7be6af25009
MD5 3dcf4af8e92178a16691d6afe817f355
BLAKE2b-256 200c2a6a2285dd9bd27cc3af5ad623778346eb17df59c9f9b6de34efa2037e9d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for redbaron-0.5.1-py2.7.egg
Algorithm Hash digest
SHA256 4c3e36b9e20054cd671e706dbbee8b08d6624804d173bc3ffa63878ad9c00ce9
MD5 8076d6779490670d6de2e7968f62356d
BLAKE2b-256 51658ca276672fbd13b338b4ffb946b2c6eff05200eb6c9e3f2dc8ceb20f960b

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