{"id":14128588,"url":"https://github.com/erdiaker/torrequest","last_synced_at":"2026-01-06T23:59:00.127Z","repository":{"id":50241392,"uuid":"65911636","full_name":"erdiaker/torrequest","owner":"erdiaker","description":"Simple Python interface for HTTP(s) requests over Tor","archived":false,"fork":false,"pushed_at":"2023-10-05T01:14:40.000Z","size":4,"stargazers_count":235,"open_issues_count":15,"forks_count":42,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-08T23:58:07.153Z","etag":null,"topics":["python","requests","tor"],"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/erdiaker.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-17T13:54:01.000Z","updated_at":"2024-10-17T17:27:26.000Z","dependencies_parsed_at":"2024-05-02T03:09:54.712Z","dependency_job_id":"7dd4c8df-f1f1-4f12-a585-170f48032462","html_url":"https://github.com/erdiaker/torrequest","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"8c1b5d0b90bbc5f302cc624a8ae61545542b99f4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdiaker%2Ftorrequest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdiaker%2Ftorrequest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdiaker%2Ftorrequest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdiaker%2Ftorrequest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erdiaker","download_url":"https://codeload.github.com/erdiaker/torrequest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228571844,"owners_count":17938772,"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":["python","requests","tor"],"created_at":"2024-08-15T16:01:52.736Z","updated_at":"2026-01-06T23:59:00.101Z","avatar_url":"https://github.com/erdiaker.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"TorRequest\n==========\n\nA simple Python interface for HTTP(s) requests over\n[Tor](https://www.torproject.org). \n```python\nfrom torrequest import TorRequest\n\nwith TorRequest() as tr:\n  response = tr.get('http://ipecho.net/plain')\n  print(response.text)  # not your IP address\n```\n\nIt's basically a wrapper around [Stem](https://stem.torproject.org) and\n[Requests](http://docs.python-requests.org/en/master/) libraries.\n\n## Dependencies\nYou need Tor. It's available via Homebrew.\n```sh\nbrew install tor\n```\n\nAfter installation, you may want to configure Tor by creating a `.torrc` file in your `$HOME` directory. More information is available on [Tor\ndocumentation](https://www.torproject.org/docs/tor-manual.html.en).\n\n## Installation\nAfter installing dependencies, you can install `torrequest` via PyPI:\n```sh\npip install torrequest\n```\n\n## Examples\n```python\nfrom torrequest import TorRequest\n\n# Choose a proxy port, a control port, and a password. \n# Defaults are 9050, 9051, and None respectively. \n# If there is already a Tor process listening the specified \n# ports, TorRequest will use that one. \n# Otherwise, it will create a new Tor process, \n# and terminate it at the end.\nwith TorRequest(proxy_port=9050, ctrl_port=9051, password=None) as tr:\n\n  # Specify HTTP verb and url.\n  resp = tr.get('http://google.com')\n  print(resp.text)\n\n  # Send data. Use basic authentication.\n  resp = tr.post('https://api.example.com', \n    data={'foo': 'bar'}, auth=('user', 'pass'))'\n  print(resp.json)\n\n  # Change your Tor circuit,\n  # and likely your observed IP address.\n  tr.reset_identity()\n\n  # TorRequest object also exposes the underlying Stem controller \n  # and Requests session objects for more flexibility.\n\n  print(type(tr.ctrl))            # a stem.control.Controller object\n  tr.ctrl.signal('CLEARDNSCACHE') # see Stem docs for the full API\n\n  print(type(tr.session))         # a requests.Session object\n  c = cookielib.CookieJar()\n  tr.session.cookies.update(c)    # see Requests docs for the full API\n```\n\n## License\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdiaker%2Ftorrequest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferdiaker%2Ftorrequest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdiaker%2Ftorrequest/lists"}