{"id":13648358,"url":"https://github.com/abingham/traad","last_synced_at":"2025-05-07T05:51:14.426Z","repository":{"id":3067674,"uuid":"4090458","full_name":"abingham/traad","owner":"abingham","description":"An JSON+HTTP server for the rope Python refactoring library","archived":false,"fork":false,"pushed_at":"2022-02-18T06:51:47.000Z","size":510,"stargazers_count":107,"open_issues_count":15,"forks_count":20,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-01T03:17:10.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abingham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-20T19:38:53.000Z","updated_at":"2024-05-19T20:53:34.000Z","dependencies_parsed_at":"2022-09-16T00:22:11.129Z","dependency_job_id":null,"html_url":"https://github.com/abingham/traad","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abingham%2Ftraad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abingham%2Ftraad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abingham%2Ftraad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abingham%2Ftraad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abingham","download_url":"https://codeload.github.com/abingham/traad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823693,"owners_count":21809709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:04:10.481Z","updated_at":"2025-05-07T05:51:14.403Z","avatar_url":"https://github.com/abingham.png","language":"Python","readme":"[![Build Status](https://travis-ci.org/abingham/traad.svg)](https://travis-ci.org/abingham/traad)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# Traad: A Python refactoring server\n\nTraad is an refactoring server for Python code. It listens for HTTP requests to\nperform refactorings, performs them, and allows clients to query for the status.\nThere is also talk from EuroPython 2014 with design description and some live demo: https://www.youtube.com/watch?v=NvV5OrVk24c\n\n## Setup\n\nTo use traad you'll normally need both the server and a client.\n\n### Emacs\n\nThe only client code (that I know of) is the\n[emacs-traad](https://github.com/abingham/emacs-traad) package for Emacs.\n`emacs-traad` is able to install the server for you, so if you're using it you\nshould just need to follow its setup instruction.\n\n### Installing the server with pip\n\nIf you just want to install the most recent release of the Python server\ncomponents (i.e. this project), you can use pip:\n```\npip install traad\n```\n\n### Installing the server from source\n\nIf you want to install the server from source - perhaps because you're doing development on it - you should first clone the repository:\n```\ngit clone https://github.com/abingham/traad\n```\n\nThen you can install everything with `setup.py`:\n```\ncd traad\npython setup.py install\n```\n\n### Python 2 vs. Python 3\n\nNote that if you install `traad` into a Python 3 environment, the server name\nwill be `traad3`. If you install it into a Python 2 environment it will simply\nbe `traad`. This makes it somewhat simpler to have system-wide installations of\nboth on systems with both Python 2 and 3.\n\n## Tests\n\n`traad` has a suite of tests in the `tests` directory. They are based on [`pytest`](http://docs.pytest.org). In order to run them, go to the project's root directory (i.e. the one containing this README) and use:\n\n```\npytest tests\n```\n\n## Rationale\n\nI (the author of traad) use emacs for most of my Python development,\nand I've often been jealous of the cool refactoring tools that my\ncolleagues get with their fancy IDEs. Not jealous enough to actually\n*switch*, of course. I'm way to stubborn for that. But I was jealous\nenough that I investigated the options available for emacs.\n\nOne of the best options available is the *rope* Python refactoring\nlibrary. Rope is very powerful and does all of the things I'd\nlike. Unfortunately, I could never find a satisfactory way of\nintegrating it into emacs. The pymacs-based approaches never quite\nworked for me, and in any case that approach struck me as somehow\nincorrect.\n\nSo, in the spirit of open-source development, I decided to try my own\napproach. I wanted a way to access rope functionality without having\nto contort either emacs or Python in unnatural ways. Thus the idea of\nusing a client-server approach was born. It may strike others as odd\nor incorrect, but it works well for me.\n\n## Design\n\nTraad is a client-server approach to using the\n[rope](https://github.com/python-rope/rope) Python refactory library. It\ninvolves two basic components:\n\n 1. A HTTP server exposing the rope API via JSON, and\n 2. Client libraries (currently just [emacs\n    lisp](https://github.com/abingham/emacs-traad)) for talking to the server\n\nThe hope is that this approach will make it easier - at least in some\ncases - to use rope from various other tools.\n\nSince rope is written in Python, any tool that wants to use rope needs\nto either embed Python, or it needs to find a way to communicate with\na Python process running rope. The embedding approach is difficult if\nthe target environment is not written in Python, and it also faces\nchallenges when dealing with more than one Python version.\n\nSo traad aims to simplify communication with rope running in an\nindependent process. HTTP communication and JSON data handling is well\nsupported in many, many languages, so any environment that wants to\nuse rope should be able to easily communicate with traad.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabingham%2Ftraad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabingham%2Ftraad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabingham%2Ftraad/lists"}