{"id":16444947,"url":"https://github.com/jaymon/reached","last_synced_at":"2025-02-26T08:24:54.447Z","repository":{"id":66175165,"uuid":"9781931","full_name":"Jaymon/reached","owner":"Jaymon","description":"Command line search and replace over an entire directory written in Python","archived":false,"fork":false,"pushed_at":"2013-05-29T22:57:41.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T22:38:18.750Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jaymon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-30T23:02:31.000Z","updated_at":"2014-04-30T02:16:44.000Z","dependencies_parsed_at":"2023-02-19T23:40:18.888Z","dependency_job_id":null,"html_url":"https://github.com/Jaymon/reached","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaymon%2Freached","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaymon%2Freached/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaymon%2Freached/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaymon%2Freached/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaymon","download_url":"https://codeload.github.com/Jaymon/reached/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240816548,"owners_count":19862308,"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-10-11T09:42:43.565Z","updated_at":"2025-02-26T08:24:54.389Z","avatar_url":"https://github.com/Jaymon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reached\n\nREplace seArCHED - Commandline search and replace over an entire directory\n\nI originally wrote this about five years ago and then forgot about it, but just recently I needed to go through\nand search/replace a large body of code and this just happened to be in an old Dropbox folder, \nso I've pulled it out, dusted it off, and cleaned it up a bit, and now I'm putting it on\nGithub so I'll remember it exists in the future.\n\n## Install\n\nUse pip:\n\n    $ pip install git+https://github.com/Jaymon/reached#egg=reached\n\nYou could also just clone the repo and run, in the repo directory:\n\n    $ python setup.py install\n\nas described [here](http://docs.python.org/2/install/)\n\n## Use\n\nAfter installation, you should be able to use this on the command line using:\n\n    $ reached --find=\u003cFIND REGEX\u003e --replace=\u003cREPLACE TEXT\u003e --dir=/path/to/search\n\nYou can also invoke it with a gui if you have TKinter Python bindings installed\n\n    $ reached --gui\n\nIt will fail spectacularly if you don't have the TKinter modules installed. The GUI\nalso doesn't have the capability to set flags like ignore case, etc.\n\nSee all the options:\n\n    $ reached --help\n\n## Example\n\nLet's say you have a folder of 500 python files and you have changed a module's name\nfrom foo to bar, so you need to change all `import foo` statements to `import bar` statements,\nyou can do that by running:\n\n    $ reached --find=foo --replace=bar --dir=/path/to/folder\n\n`Reached` will prompt for each replacement, so you don't have to worry about it changing something\nyou didn't mean to change.\n\nNow, let's say that just searching for foo was too broad, `--find` can use any supported regex that\nPython's [re module](http://docs.python.org/2/library/re.html) uses, so let's say you instead wanted to\nonly find foo's that are preceded by a space and followed by a period:\n\n    $ reached --find=\"(?\u003c=\\s)foo\\.\" --replace=\"foo.\" --ext=py --dir=./\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaymon%2Freached","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaymon%2Freached","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaymon%2Freached/lists"}