baron之上的抽象,python的fst,使编写重构代码成为一项现实的任务。

redbaron的Python项目详细描述


简介[构建状态](https://travis-ci.org/pycqa/redbaron.svg?branch=master)(https://travis-ci.org/pycqa/redbaron)[![最新版本](https://img.shields.io/pypi/v/redbaron.svg)(https://pypi.python.org/pypi/redbaron/)[![支持的python版本](https://img.shields.io/pypi/pyversions/redbaron.svg)(https://pypi.python.org/pypi/redbaron/)[![开发状态](https://img.shields.io/pypi/status/redbaron.svg)(https://pypi.python.org/pypi/redbaron/)[![车轮状态](https://img.shields.io/pypi/wheel/redbaron.svg)(https://pypi.python.org/pypi/redbaron/)[![下载格式](https://img.shields.io/pypi/format/redbaron.svg)(https://pypi.python.org/pypi/redbaron/)[![许可证](https://img.shields.io/pypi/l/redbaron.svg)(https://pypi.python.org/pypi/redbaron/)
[![公开集体的支持者](https://open collective.com/redbaron/backers/badge.svg)](支持者)
[![OpenCollective上的赞助者](https://open collective.com/redbaron/赞助者/badge.svg)](赞助者)


redbaron是一个python库和工具,功能强大,足以用于ipython
,目的仅仅是让**编写修改源代码的过程简单易行。尽可能的。包括编写自定义重构、通用重构、工具,IDE或直接将代码修改为IPython,其抽象性比高级文本编辑器和IDE中的高级文本修改工具更高、更强大。

Redbaron向您保证,**它只会在您要求他修改代码时修改代码。为此,它基于[baron](https://github.com/pycqa/baron)
一个无损的[ast](https://en.wikipedia.org/wiki/abstract_syntax_tree),用于
保证操作的python<;code>;ast_to_code(code_to_ast(source_code))==source_code<;/code>;
(baron的ast称为一个完整的语法树)。它试图变得简单直观,一旦你掌握了基本原理,你就可以在80%的操作中不必阅读文档了。核心是相当稳定的,但它还没有经过战斗测试,还有些粗糙。**非常欢迎反馈和贡献。



这一点)。
可能只有一个例外,即如果您直接使用fst调用特定节点
构造函数,则此api会发生更改,但这并没有记录在案,而且
非常不实际,所以我希望没有人会这么做。


可能是代码生成)和性能改进。

测试
==


>pip install py test


==


频道=%23baron)或[irc.freenode.net python代码质量](https://webchat.freenode.net/?channels=%23%23python代码质量)。


financial support
===


baron和redbaron是一个非常先进的工程,需要大量的专注时间才能完成。到2018年底,开发工作一直是一项全方位的志愿者工作,主要由[BRAM]完成(https://github.com/psycojoker),
,但现在,为了达到下一个水平,使这些项目达到稳定,并提高您所需的质量,我们将继续努力。CT,我们需要您的支持。

另一方面,这些项目的研发方面。



[[成为赞助者](https://opencollective.com/redbaron backer)]

<;a href="https://opencollective.com/redbaron backers"target="u blank">;<;img src="https://opencollective.com/redbaron/backers.svg?width=890">;


您的徽标将显示在这里,并带有指向您网站的链接。[[成为赞助人](https://opencollective.com/redbaron赞助人)]

<;a href="https://opencollective.com/redbaron/ssonsor/0/website"target="u blank">;<;img src="https://opencollective.com/redbaron/ssonsor/0/avatar.svg">;<;/a>;
<;a href="https://opencollective.com/redbaron/sponsor/1/website"target="掼blank">;<;img src="https://opencollective.com/redbaron/sponsor/1/avatar.svg">;
<;a href="https://opencollective.com/redbaron/sponsor/2/website"target="掼blank">;<;img src="https://opencollective.com/redbaron/sponsor/2/avatar.svg">;
<;a href="https://opencollective.com/redbaron/sponsor/3/website"target="\u blank">;<;img src="https://opencollective.com/redbaron/sponsor/3/avatar.svg">;
<;a href="https://opencollective.com/redbaron/ssonsor/4/website"target="掼blank">;<;img src="https://opencollective.com/redbaron/ssonsor/4/avatar.svg">;
<;a href="https://opencollective.com/redbaron/ssonsor/5/website"target="掼blank">;<;img src="https://opencollective.com/redbaron/sponsor/5/avatar.svg">;
<;a href="https://opencollective.com/redbaron/sponsor/6/website"target="轱blank">;<;img src="https://opencollective.com/redbaron/sponsor/6/avatar.svg">;<;/a>;
<;a href="https://opencollective.com/redbaron/sponsor/7/website"target="掼blank">;<;img src="https://opencollective.com/redbaron/sponsor/7/avatar.svg">;
<;a href="https://opencollective.com/redbaron/sponsor/8/website"target="掼blank">;<;img src="https://opencollective.com/redbaron/sponsor/8/avatar.svg">;
<;a href="https://opencollective.com/redbaron/sponsor/9/website"target="轱blank">;<;img src="https://opencollective.com/redbaron/sponsor/9/avatar.svg">;<;/a>;


<;a href="https://github.com/pycqa/redbaron/contributors">;<;img src="https://opencollective.com/redbaron/contributors.svg?width=890&button=false"/>;


redbaron遵循其[行为准则](http://meta.pycqa.org/en/latest/code of conduct.html)。


一定要查看教程和文档**。

*[教程](https://redbaron.readthedocs.io/en/latest/tuto.html)
*[文档](https://redbaron.readthedocs.io/en/latest/)
*[巴龙](https://github.com/pycqa/baron)
*irc聊天:[irc.freenode.net baron](https://webchat.freenode.net/?channels=%23baron)



changelog
==


0.9.2(2019-03-17)
----


-修复.help()中的情况,其中一些代码被hanaasagi https://github.com/pycqa/redbaron/pull/182着色了两次(2019-02-01)
----


-修复.names()和未处理fromImport节点上存在"(")的情况的变体

>0.9(2019-02-01)
----


-完整的python 3.7语法支持

-中断更改:批注现在是{def的成员,Dic列表t}参数来扁平化数据结构,typednamode不再存在
-添加对bram返回注释的支持
-添加对scottbelden的变量注释https://github.com/pycqa/redbaron/pull/177的支持,以及bram的附加工作
-添加对bram的raise from的支持

0.8(2018-10-29)
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————在以前的版本中缺少

0.7(2018-08-21)
----


-在使用duncf进行求值之前,通过去除空白缩进字符串时修复为python()(https://github.com/pycqa/redbaron/pull/140

-支持省略号
-支持矩阵运算符
-支持f字符串
-支持数字文本
-支持非本地语句
-仅支持关键字标记
-支持语句的屈服
-支持异步/等待语句


0.6.3(2017-01-02)
----

-修复在append
之后的help()-如果代码不在shell中运行,则修复基本节点的synchronise(),以避免repr\uu函数中的递归
-add a t方法

>0.6.2(2016-10-03)
-------无限递归调用并降低性能
-修复iter-in-rendering方法以避免边缘情况下的错误(问题107)


0.6.1(2016-03-28)
----

-fix setup.py,由于将redbaron.py
拆分为多个文件,因此没有在pypi上推送包。


您可以直接用fst调用特定的节点
构造函数来更改此api,但这并没有记录在案,而且
非常不实际,因此,我希望没有人会这么做。

从现在开始,重点将是转向稳定的1.0版本,这意味着:错误修复和
api添加,以弥补缺少的必要功能,不再进行大的修改,这将适用于其他版本,工作量已经够大了。

-对代理列表合并算法有了很大的改进,它还不是完美的(注释还没有处理),但它确实是一个很大的进步
-可能的可追溯性中断更改:从现在开始在节点上查找("name")到节点。仅限名称快捷方式使用可能的节点标识符。例如node.i_dont_exist_as_an_标识符将引发attributeRor
-新的helper方法。to_python在兼容节点https://redbaron.readthedocs.io/en/latest/other.html上包装ast.literal_eval到python
-breaking:intnode不再返回int on.value,而是返回.string,使用.to_python将计算版本设置为
-fix node.decrease_indentation(这根本不起作用)
-fix code_block_node.value在没有父节点的节点上断开
-add string representation for path object
-now redbaron path()类可以直接与baron进行比较路径
不使用to_baron_path()helper。
-由Novocaine修复:将"function"用作函数类型检测器而不是"def"
-在nodelist和proxylist上添加具有相同API的getitem()方法
-修复:在代码块周围插入行时不一致
-插入空白行在lineproxylist中有效地插入a\n
-新的助手方法:.next\u recursive和.previous\u recursive https://redbaron.readthedocs.io/en/latest/other.html
-修复:doc现在在ci中测试,它不应该再中断
-python3的更多呈现测试,它不应该再中断
-pygments现在是一个可选依赖项,"pip install redbaron"不会安装它,"pip install redbaron[pygments"]会
-新节点。下一步ive和node.previous是一种直观的方法,用于.next/previous不按用户期望的方式运行的情况https://redbaron.readthedocs.io/en/latest/other.html;next直觉previous直觉使用函数的最后一个方法的.insert()
-decoratorProxylist未正确处理其最后一个endl标记的缩进

>0.5(2015-01-31)
----


-fix index handling in get_absolute_bounding_of_attribute method in
a lineproxylist
-在ipython笔记本中使用_repr_html_u对redbaron repr进行漂亮的渲染,请参见:
https://cloud.githubusercontent.com/assets/41827/5731132/65ff4c92-9b80-11e4-977c-0faebbf63415.png
-fix:redbaron repr在bpython和ipython笔记本中崩溃。新的
行为应该更加稳定,不会崩溃。
-新的helpers.names,.modules,.full_path_modules for from_import node https://redbaron.readthedocs.io/en/latest/other.html index on parent raw
-添加node.index_on撸parent撸raw并使node.index撸on撸parent works有它
应该直观地根据代理列表API https://redbaron.readthedocs.io/en/latest/other.html在父raw上的索引
-新的帮助程序方法:.insert在https://redbaron.readthedocs.io/en/latest/other.html insert before and.insert在https://redbaron.readthedocs.io/en/latest/other.html insert before insert after
-修复:一些空白行代理合并算法中的错误
-修复:在新添加的元素上正确地设置了on_属性和父元素以
根节点

>0.4(2014-12-11)
----

def_arguments structure)
-修复:redbaron中不支持long(由于baron中的错误)


0.3(2014-11-12)
----



-代理列表,对列表管理的重大改进
-。append_value不再有效,因为它现在由于代理列表而无用-.index已重命名为.index_on_parent以使其更连贯


0.2(2014-09-23)
——————————————————————————————————————————————————————————————————————————————————————————这是一个巨大的改进
https://redbaron.readthedocs.io/en/latest/modifying.html完整文档
-现在可以在.find和
中使用regex、globs、list/tuple和lambda(可调用)。find all,请参阅https://redbaron.readthedocs.io/en/latest/querying.html高级查询
-节点上的新方法:.replace()替换到位的节点
https://redbaron.readthedocs.io/en/latest/other.html replace
-.map.filter和.apply现在已记录在https://redbaron.readthedocs.io/en/latest/other.html map filter apply
-.edit()新的帮助器方法以启动文本选定节点上的编辑器,并用修改后的代码https://redbaron.readthedocs.io/en/latest/other.html替换该节点;edit
-.root节点属性(属性),该属性返回存储
节点的树的根节点https://redbaron.readthedocs.io/en/latest/other.html root
-.index节点属性(property),如果节点存储在nodelist中,则返回节点所在的索引
store,否则,nodelist上的https://redbaron.readthedocs.io/en/latest/other.html index
-setitem(a[x]=b)现在可以按预期工作(接受字符串,fst
节点和redbaron节点)
-处理缩进的新方法:.增加缩进和.减少缩进https://redbaron.readthedocs.io/en/latest/other.html;增加缩进和减少缩进
-各种小错误修复
-我们有一个新的贡献者/https://github.com/ze42
-to-u节点已移动到node:node的类方法。from-fst
-在脚本中使用redbaron时节点的漂亮打印


0.1(2014-06-13)
----

-first release

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
SpringBoot如何在Java中创建固定长度的平面文件?   java是freemarker类型。果心无法解决此问题。它是从required间接引用的。类文件   设置字符串格式时发生java FormatFlagsTransversionMismatchException异常   无法将java应用程序连接到sql server 2008 R2   在关闭事件之前,使用Java API BMC补救方法更新“分类”   java如何在使用opencsv写入csv时保持空值   java在spring中是否需要事务属性?   java Hibernate抑制信息消息   java如何在spring data cosmos的@Container中给出布尔值?   java获取旋转矩形的角   如何在java中获得对象的两个数组列表的差异   java与新接口相比,嵌套模板的优点和缺点是什么?   Java Apache Derby十进制列数据为0.001输出为0.0   用于隐藏包含特定单词的元素的javascript用户脚本   java Jackson objectMapper无法读取UTF8   java在JavaFX中创建太多事件处理程序   如何在运行Redhat Linux的amazon ec2微实例上卸载openjdk   如何使用Java swing创建一个动态列表,其中必须为每个元素指定多个参数   java如何在将面板放置在gridlayout上时消除面板之间的间隙?   java标准方法名称,为什么println中的l不是大写?