{"id":13594237,"url":"https://github.com/torpyorg/torpy","last_synced_at":"2025-10-21T20:00:12.122Z","repository":{"id":41413308,"uuid":"196162569","full_name":"torpyorg/torpy","owner":"torpyorg","description":"Pure python Tor client implementation","archived":false,"fork":false,"pushed_at":"2023-04-21T18:45:11.000Z","size":2097,"stargazers_count":428,"open_issues_count":22,"forks_count":55,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-10-21T19:59:56.988Z","etag":null,"topics":["hidden-services","python","python-tor-client","python-tor-protocol","tor","tor-client","tor-network","tor-protocol"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/torpyorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null},"funding":{"custom":["https://btc.com/16mF9TYaJKkb9eGbZ5jGuJbodTF3mYvcRF","https://coinrequest.io/request/anscJbCsqucdJ1m"]}},"created_at":"2019-07-10T08:14:18.000Z","updated_at":"2025-10-21T19:01:59.000Z","dependencies_parsed_at":"2024-04-06T11:44:14.461Z","dependency_job_id":null,"html_url":"https://github.com/torpyorg/torpy","commit_stats":{"total_commits":60,"total_committers":1,"mean_commits":60.0,"dds":0.0,"last_synced_commit":"ebf000cc93d2d7b3ddf68f2604afd46c998ae1c1"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/torpyorg/torpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torpyorg%2Ftorpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torpyorg%2Ftorpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torpyorg%2Ftorpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torpyorg%2Ftorpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torpyorg","download_url":"https://codeload.github.com/torpyorg/torpy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torpyorg%2Ftorpy/sbom","scorecard":{"id":895071,"data":{"date":"2025-08-11","repo":{"name":"github.com/torpyorg/torpy","commit":"ebf000cc93d2d7b3ddf68f2604afd46c998ae1c1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3ww4-gg4f-jr7f","Warn: Project is vulnerable to: GHSA-5cpq-8wj7-hf2v","Warn: Project is vulnerable to: GHSA-9v9h-cgj8-h64p","Warn: Project is vulnerable to: PYSEC-2023-254 / GHSA-jfhm-5ghh-2f97","Warn: Project is vulnerable to: GHSA-jm77-qphf-c4w8","Warn: Project is vulnerable to: GHSA-v8gr-m533-ghj9","Warn: Project is vulnerable to: GHSA-w7pp-m8wf-vj6r","Warn: Project is vulnerable to: GHSA-x4qr-2fvf-3mr5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T13:22:37.835Z","repository_id":41413308,"created_at":"2025-08-24T13:22:37.835Z","updated_at":"2025-08-24T13:22:37.835Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280325299,"owners_count":26311419,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hidden-services","python","python-tor-client","python-tor-protocol","tor","tor-client","tor-network","tor-protocol"],"created_at":"2024-08-01T16:01:30.542Z","updated_at":"2025-10-21T20:00:12.089Z","avatar_url":"https://github.com/torpyorg.png","language":"Python","readme":"Torpy ![Python Versions] [![Build Status](https://travis-ci.com/torpyorg/torpy.svg?branch=master)](https://travis-ci.com/torpyorg/torpy) [![Build status](https://ci.appveyor.com/api/projects/status/14l6t8nq4tvno1pg?svg=true)](https://ci.appveyor.com/project/jbrown299/torpy) [![Coverage Status](https://coveralls.io/repos/github/torpyorg/torpy/badge.svg?branch=master)](https://coveralls.io/github/torpyorg/torpy?branch=master)\n=====\n\nA pure python Tor client implementation of the Tor protocol.\nTorpy can be used to communicate with clearnet hosts or hidden services through the [Tor Network](https://torproject.org/about/overview.html).\n\n**Features**\n- No Stem or official Tor client required\n- Support v2 hidden services ([v2 specification](https://gitweb.torproject.org/torspec.git/tree/rend-spec-v2.txt))\n- Support *Basic* and *Stealth* authorization protocol\n- Provide simple [TorHttpAdapter](https://github.com/torpyorg/torpy/blob/master/torpy/http/adapter.py) for [requests](https://requests.readthedocs.io/) library\n- Provide simple urllib [tor_opener](https://github.com/torpyorg/torpy/blob/master/torpy/http/urlopener.py) for making requests without any dependencies\n- Provide simple Socks5 proxy\n\n**Donation**\n\nIf you find this project interesting, you can send some [Bitcoins](https://bitcoin.org/) to address: `16mF9TYaJKkb9eGbZ5jGuJbodTF3mYvcRF`\n\n**Note**\n\nThis product is produced independently from the Tor® anonymity software and carries no guarantee from [The Tor Project](https://www.torproject.org/) about quality, suitability or anything else.\n\nConsole examples\n-----------\nThere are several console utilities to test the client.\n\nA simple HTTP/HTTPS request:\n```bash\n$ torpy_cli --url https://ifconfig.me --header \"User-Agent\" \"curl/7.37.0\"\nLoading cached NetworkStatusDocument from TorCacheDirStorage: .local/share/torpy/network_status\nLoading cached DirKeyCertificateList from TorCacheDirStorage: .local/share/torpy/dir_key_certificates\nConnecting to guard node 141.98.136.79:443 (Poseidon; Tor 0.4.3.6)... (TorClient)\nSending: GET https://ifconfig.me\nCreating new circuit #80000001 with 141.98.136.79:443 (Poseidon; Tor 0.4.3.6) router...\n...\nBuilding 3 hops circuit...\nExtending the circuit #80000001 with 109.70.100.23:443 (kren; Tor 0.4.4.5)...\n...\nExtending the circuit #80000001 with 199.249.230.175:443 (Quintex86; Tor 0.4.4.5)...\n...\nStream #4: creating attached to #80000001 circuit...\nStream #4: connecting to ('ifconfig.me', 443)\nStream #4: connected (remote ip '216.239.36.21')\nStream #4: closing (state = Connected)...\nStream #4: remote disconnected (reason = DONE)\nResponse status: 200\nStream #4: closing (state = Closed)...\nStream #4: closed already\nClosing guard connections (TorClient)...\nDestroy circuit #80000001\nClosing guard connections (Router descriptor downloader)...\nDestroy circuit #80000002\n\u003e 199.249.230.175\n```\n\nCreate Socks5 proxy to relay requests via the Tor Network:\n```\n$ torpy_socks -p 1050 --hops 3\nLoading cached NetworkStatusDocument from TorCacheDirStorage: .local/share/torpy/network_status\nConnecting to guard node 89.142.75.60:9001 (spongebobness; Tor 0.3.5.8)...\nCreating new circuit #80000001 with 89.142.75.60:9001 (spongebobness; Tor 0.3.5.8) router...\nBuilding 3 hops circuit...\nExtending the circuit #80000001 with 185.248.143.42:9001 (torciusv; Tor 0.3.5.8)...\nExtending the circuit #80000001 with 158.174.122.199:9005 (che1; Tor 0.4.1.6)...\nStart socks proxy at 127.0.0.1:1050\n...\n```\n\nTorpy module also has a command-line interface:\n\n```bash\n$ python3.7 -m torpy --url https://facebookcorewwwi.onion --to-file index.html\nLoading cached NetworkStatusDocument from TorCacheDirStorage: .local/share/torpy/network_status\nConnecting to guard node 185.2.31.8:443 (cx10TorServer; Tor 0.4.0.5)...\nSending: GET https://facebookcorewwwi.onion\nCreating new circuit #80000001 with 185.2.31.8:443 (cx10TorServer; Tor 0.4.0.5) router...\nBuilding 3 hops circuit...\nExtending the circuit #80000001 with 144.172.71.110:8447 (TonyBamanaboni; Tor 0.4.1.5)...\nExtending the circuit #80000001 with 179.43.134.154:9001 (father; Tor 0.4.0.5)...\nCreating stream #1 attached to #80000001 circuit...\nStream #1: connecting to ('facebookcorewwwi.onion', 443)\nExtending #80000001 circuit for hidden service facebookcorewwwi.onion...\nRendezvous established (CellRelayRendezvousEstablished())\nIterate over responsible dirs of the hidden service\nIterate over introduction points of the hidden service\nCreate circuit for hsdir\nCreating new circuit #80000002 with 185.2.31.8:443 (cx10TorServer; Tor 0.4.0.5) router...\nBuilding 0 hops circuit...\nExtending the circuit #80000002 with 132.248.241.5:9001 (toritounam; Tor 0.3.5.8)...\nCreating stream #2 attached to #80000002 circuit...\nStream #2: connecting to hsdir\nStream #2: closing...\nDestroy circuit #80000002\nCreating new circuit #80000003 with 185.2.31.8:443 (cx10TorServer; Tor 0.4.0.5) router...\nBuilding 0 hops circuit...\nExtending the circuit #80000003 with 88.198.17.248:8443 (bauruine31; Tor 0.4.1.5)...\nIntroduced (CellRelayIntroduceAck())\nDestroy circuit #80000003\nCreating stream #3 attached to #80000001 circuit...\nStream #3: connecting to ('www.facebookcorewwwi.onion', 443)\nExtending #80000001 circuit for hidden service facebookcorewwwi.onion...\nResponse status: 200\nWriting to file index.html\nStream #1: closing...\nStream #3: closing...\nClosing guard connections...\nDestroy circuit #80000001\n```\n\nUsage examples \n-----------\n\nA basic example of how to send some data to a clearnet host or a hidden service:\n```python\nfrom torpy import TorClient\n\nhostname = 'ifconfig.me'  # It's possible use onion hostname here as well\nwith TorClient() as tor:\n    # Choose random guard node and create 3-hops circuit\n    with tor.create_circuit(3) as circuit:\n        # Create tor stream to host\n        with circuit.create_stream((hostname, 80)) as stream:\n            # Now we can communicate with host\n            stream.send(b'GET / HTTP/1.0\\r\\nHost: %s\\r\\n\\r\\n' % hostname.encode())\n            recv = stream.recv(1024)\n```\n\nTorHttpAdapter is a convenient Tor adapter for the [requests library](https://2.python-requests.org/en/master/user/advanced/#transport-adapters).\nThe following example shows the usage of TorHttpAdapter for multi-threaded HTTP requests:\n```python\nfrom multiprocessing.pool import ThreadPool\nfrom torpy.http.requests import tor_requests_session\n\nwith tor_requests_session() as s:  # returns requests.Session() object\n    links = ['http://nzxj65x32vh2fkhk.onion', 'http://facebookcorewwwi.onion'] * 2\n\n    with ThreadPool(3) as pool:\n        pool.map(s.get, links)\n\n```\n\nFor more examples see [test_integration.py](https://github.com/torpyorg/torpy/blob/master/tests/integration/test_integration.py)\n\n\nInstallation\n------------\n* Just `pip3 install torpy`\n* Or for using TorHttpAdapter with requests library you need install extras:\n`pip3 install torpy[requests]`\n\nContribute\n----------\n* Use It\n* Code review is appreciated\n* Open [Issue], send [PR]\n\n\nTODO\n----\n- [ ] Implement v3 hidden services [specification](https://gitweb.torproject.org/torspec.git/tree/rend-spec-v3.txt)\n- [ ] Refactor Tor cells serialization/deserialization\n- [ ] More unit tests\n- [ ] Rewrite the library using asyncio\n- [ ] Implement onion services\n\n\nLicense\n-------\nLicensed under the Apache License, Version 2.0\n\n\nReferences\n----------\n- Official [Tor](https://gitweb.torproject.org/tor.git/) client\n- [Pycepa](https://github.com/pycepa/pycepa)\n- [TorPylle](https://github.com/cea-sec/TorPylle)\n- [TinyTor](https://github.com/Marten4n6/TinyTor)\n- C++ Windows only implementation [Mini-tor](https://github.com/wbenny/mini-tor)\n- Nice Java implementation [Orchid](https://github.com/subgraph/Orchid)\n\n\n[Python Versions]:      https://img.shields.io/badge/python-3.6,%203.7,%203.8,%203.9-blue.svg\n[Issue]:                https://github.com/torpyorg/torpy/issues\n[PR]:                   https://github.com/torpyorg/torpy/pulls","funding_links":["https://btc.com/16mF9TYaJKkb9eGbZ5jGuJbodTF3mYvcRF","https://coinrequest.io/request/anscJbCsqucdJ1m"],"categories":["Python","\u003ca id=\"8c5a692b5d26527ef346687e047c5c21\"\u003e\u003c/a\u003e收集"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorpyorg%2Ftorpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorpyorg%2Ftorpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorpyorg%2Ftorpy/lists"}