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

  • Sorting scopes
  • Showing probable occurrences in show occurrences
  • Cleaning up rope.ide.codeassist module

You can use C-c s ... for sorting current scope. ... can be one of:

  • a: alphabetically
  • A: alphabetically reversed
  • k: classes first
  • K: functions first
  • u: underlineds first
  • U: underlineds last
  • p: those that have pydoc first
  • P: those that don’t have pydoc first
  • s: special methods first
  • S: special methods last

Note that capitals sort in the reverse order of normals. Sorts are stable. So if you want to sort by kind and alphabetically, for instance, you can use C-c s a followed by C-c s k.

Show occurrences dialog (C-c C-s) now shows possible matches, too. These matches end with a question mark.

rope.ide.codeassist has been cleaned up. Now you can do something like:

from rope.ide import codeassist

# Get the completions
proposals = codeassist.code_assist(project, source_code, offset)
# Sorting proposals
proposals = codeassist.sorted_proposals(proposals)
# Where to insert the completions
starting_offset = codeassist.starting_offset(source_code, offset)

See pydocs and source code for more information (other functions in that module might be interesting, too; like get_doc, get_definition_location and find_occurrences). Note that this module is included in ropeide package.

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