{"library":"rope","title":"Rope","description":"Rope is an advanced, open-source Python refactoring library. It provides extensive APIs for performing various code transformations like renaming, extracting methods, and moving elements. Actively maintained, it sees regular updates with recent releases like 1.14.0, and supports modern Python versions.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install rope"],"cli":null},"imports":["from rope.base.project import Project","from rope.base.resources import File","from rope.refactor.rename import Rename"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport tempfile\nimport shutil\nfrom pathlib import Path\nfrom rope.base.project import Project\nfrom rope.base.resources import File\nfrom rope.refactor.rename import Rename\n\n# Create a temporary directory and a dummy Python file\ntemp_dir = Path(tempfile.mkdtemp())\nfile_path = temp_dir / \"my_module.py\"\nfile_path.write_text(\"\"\"\ndef greet():\n    old_name = \"World\"\n    print(f\"Hello, {old_name}!\")\n\"\"\")\n\nproject = Project(temp_dir)\nresource = project.get_resource(file_path.name)\n\n# Find the start offset of 'old_name'\n# In '    old_name = \"World\"', 'old_name' starts at index 5\noffset = file_path.read_text().find('old_name = \"World\"') + 4\n\n# Perform rename refactoring\nchanges = Rename(project, resource, offset).get_changes('new_name')\n\n# Apply the changes to the project files\nproject.do(changes)\n\n# Verify the change\nprint(file_path.read_text())\n\n# Clean up\nproject.close()\nshutil.rmtree(temp_dir)","lang":"python","description":"This example demonstrates how to initialize a Rope project, load a Python file, and perform a simple variable renaming refactoring. It creates a temporary file and directory, renames a variable 'old_name' to 'new_name', applies the changes, and then cleans up. The `Project` object manages the codebase, `Resource` objects represent files, and specific refactoring classes (like `Rename`) perform transformations.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"1.14.0","pypi_latest":"1.14.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2,"avg_import_s":0.35,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.33,"mem_mb":8.6,"disk_size":"21.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.9,"import_time_s":0.23,"mem_mb":8.6,"disk_size":"22M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.47,"mem_mb":10.6,"disk_size":"23.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2,"import_time_s":0.43,"mem_mb":10.5,"disk_size":"24M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.4,"mem_mb":9.7,"disk_size":"15.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.39,"mem_mb":9.7,"disk_size":"16M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.35,"mem_mb":10,"disk_size":"15.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.36,"mem_mb":10,"disk_size":"16M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.3,"mem_mb":8.3,"disk_size":"20.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"rope","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.3,"import_time_s":0.26,"mem_mb":8.3,"disk_size":"21M"}]}}