tor-python-easy
tor-python-easy was developed for use tor proxy in python with easy interface, which allow for changing ip address whenever you want.
Repo is very simple but if you want you can add new feature request.
Donate
If you want to sponsor me, in thanks for the project, please send me some crypto 😁:
| Coin | Wallet address |
|---|---|
| Bitcoin | 3EajE9DbLvEmBHLRzjDfG86LyZB4jzsZyg |
| Etherum | 0xE43d8C2c7a9af286bc2fc0568e2812151AF9b1FD |
Installation
Library is only one file, so you can copy it to project.
However, if you want you can install it with pip:
pip3 install tor-python-easy
Run tor proxy
There are two simple ways to run tor proxy.
- First one is using docker and docker-compose from this repo. You can manipulate with mapping
ports and password.
docker-compose up - Second one uses tor installed in OS
tor --controlport 9051
Use lib with python
-
In terminal
docker-compose up -
In Python
from tor_python_easy.tor_control_port_client import TorControlPortClient from tor_python_easy.tor_socks_get_ip_client import TorSocksGetIpClient if __name__ == '__main__': proxy_config = { 'http': 'socks5://localhost:9050', 'https': 'socks5://localhost:9050', } ip_client = TorSocksGetIpClient(proxy_config) tor_control_port_client = TorControlPortClient('localhost', 9051, 'test1234') for it in range(10): old_ip = ip_client.get_ip() tor_control_port_client.change_connection_ip(seconds_wait=10) new_ip = ip_client.get_ip() print(f'iteration {it + 1} :: {old_ip} -> {new_ip}')
Output will give 10 IP migrations.
Metadata
Release files for tor-python-easy 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tor_python_easy-0.1.7.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tor_python_easy-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.6 kB
Release files / tor_python_easy-0.1.7.tar.gz
| Download URL | tor_python_easy-0.1.7.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
baa111478a2d4383837c423b141c1e29ae15123c165e26d2c6b765cb469a4a21
|
|
BLAKE2b-256 checksum How to use checksums |
f80c0811328041aef6570f47cfbbc21a96aeda5a632f21cdff9261e85f44a6f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.16 Linux/5.15.0-1039-azure
|
Release files / tor_python_easy-0.1.7-py3-none-any.whl
| Download URL | tor_python_easy-0.1.7-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8b70008d29fc4d213d4485868fbf74763c1c2178d34eca2145af041215d680b
|
|
BLAKE2b-256 checksum How to use checksums |
ee07bfb224c1043dcfd8c3f091c4302dd281e797ab58fd363a3bf98e8f018f45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.16 Linux/5.15.0-1039-azure
|