Rope, a python refactoring library ...
Rope is a python refactoring library. You can get it from
here or if you plan to
use it with py3k from here.
You can use rope as a library in other IDEs.
Features
Refactorings:
- Rename everything!
- Extract method/local variable
- Move class/function/module/package/method
- Inline method/local variable/parameter
- Restructuring (like converting "${a}.f(${b})" to
"${b}.g(${a})" where "a: type=mymod.A")
- Introduce factory
- Change method signature
- Transform module to package
- Encapsulate field
- Replace method with method object
- And a few others
Refactoring Features:
- Extracting similar statements in extract refactorings
- Fixing imports when needed
- Previewing refactorings
- Undo/redo refactorings
- Stopping refactorings
- Cross-project refactorings
- Basic implicit interfaces handling in rename and change signature
- Mercurial, GIT, Darcs and SVN support in refactorings
IDE helpers:
- Auto-completion
- Definition location
- Get pydoc
- Find occurrences
- Organize imports (remove unused and duplicate imports and sort them)
- Generating python elements
Object Inference:
- Static and dynamic object analysis
- Handling built-in container types
- Saving object information on disk and validating them
For more information have a look at rope overview.
Related Projects
IDEs and plugins that use rope to provide features like refactorings
and code-assists:
- ropemacs: an emacs plugin
- ropevim: a vim plugin
- eric4: includes
rope as a plugin
- spyder: its source editor
provides some of rope's features
- snaked: provides code assist
and enhances rope object inference through user-provided rules
- Traad: a client-server
approach to using rope, especially useful for non-python IDE's;
uses XMLRPC for communication and includes client libraries for elisp
- ropeide: uses tkinter library (currently unmaintained)
Hacking
See contributing. Main rope repositories:
Snapshots:
Feedback
Send your bug reports, feature requests and patches to
rope-dev (at) googlegroups.com.
For subscribing send an email to rope-dev-subscribe (at) googlegroups.com.