Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

a python refactoring library...

Project description


rope is a python refactoring library and IDE. The IDE uses the library to provide features like refactoring, code assist, and auto-completion. It is written in python. The IDE uses Tkinter library.

Rope IDE and library are released in two separate packages. rope package contains only the library and ropeide package contains the IDE and the library.

New Features

  • Handling imports when inlining
  • Handling recursive restructurings
  • Better diff highlighting

Inline method refactoring can add imports when necessary. For instance consider is:

import sys

class C(object):

def do_something():
    print sys.version
    return C()

and is:

import mod1

c = mod1.do_something()

After inlining do_something, would be:

import mod1
import sys

print sys.version
c = mod1.C()

Also rope can inline class methods; for instance in:

class C(object):
    def say_hello(cls, name):
        return 'Saying hello to %s from %s' % (name, cls.__name__)
hello = C.say_hello('Rope')

inlining say_hello will result in:

class C(object):
hello = 'Saying hello to %s from %s' % ('Rope', C.__name__)

Restructurings can handle recursive patterns like searching for ${?a} // ${?b} in 1 // 2 // 3. Also the diffs in show history and preview changes dialog are highlighted.

Project details

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page