# Tor Switch
Python package to interact with tor and control IP address rotations.
Installation
- install tor
sudo apt install tor
- install torswitch
pip3 install torswitch
Usage
from torswitch import TorProtocol
#Create your network
thisnetwork=TorProtocol()
#start your tor network
thisnetwork.Start()
#for changing your ip use
thisnetwork.NewTorIp()
"""
NewTorIP() just request for new ip, ip maybe or maybe not change
"""
#for getting absolute new ip use
thisnetwork.AbsoluteNewTorIp()
#for continues ip rotation use
thisnetwork.TorIpRotation(delay=3,limit=12)
"""
delay is to define the time gap(in seconds) between new ip address request.
limit is to define how many time you want to make request,default is 10
"""
#finally to stop tor
thisnetwork.Stop()
Use tor as proxy
import requests
from torswitch import TorProtocol
thisnetwork=TorProtocol()
thisnetwork.Start()
proxies = {
'http': 'socks5://127.0.0.1:9050',
'https': 'socks5://127.0.0.1:9050'
}
proxy=requests.get('https://api.ipify.org',proxies=proxies).text
print(proxy)
thisnetwork.Stop()
Metadata
Release files for torswitch 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| torswitch-2.0.2.tar.gz | 5.3 kB | Without provenance | Details for torswitch-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| torswitch-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for torswitch-2.0.2-py3-none-any.whl |
Total release size: 11.4 kB
Release files / torswitch-2.0.2.tar.gz
| Download URL | torswitch-2.0.2.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
041a6108b58fc74f065ac3efca22c313a5f6491c5a46d487906c2ea162886f36
|
|
BLAKE2b-256 checksum How to use checksums |
de86682de8b459c860503c222d6ff9f27173e4189d38a7e014fb80cdcfc417ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / torswitch-2.0.2-py3-none-any.whl
| Download URL | torswitch-2.0.2-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2a1060d2b1eac5d7e8d9fb85c8891d7d28f5c21263e3db91121aa068cbd43e7
|
|
BLAKE2b-256 checksum How to use checksums |
37c0bb67a391a6ad6658f3868f48b76db7be6eb95bb7497a123cee94dcd04e9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for torswitch 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.