proxy randomizer
Project description
proxy-randomizer
proxy randomizer
Free software: MIT license
Documentation: https://proxy-randomizer.readthedocs.io.
Installation
pip install proxy_randomizer
API
To use proxy_randomizer in your code, you just need to generate a RegisteredProviders instance and parse the providers.
from proxy_randomizer.providers import RegisteredProviders
rp = RegisteredProviders()
rp.parse_providers()
print(f"proxy: {rp.get_random_proxy()}")
You can iterate throughout all proxies as simple as this.
from proxy_randomizer.providers import RegisteredProviders
import requests
rp = RegisteredProviders()
rp.parse_providers()
for proxy in rp.proxies:
proxies = { "https": f"{proxy.ip_address}:{proxy.port}" }
response = requests.get("http://google.com", proxies=proxies)
If you need to hide your identity, you can filter the proxy list by its anonymity level.
from proxy_randomizer.providers import RegisteredProviders
from proxy_randomizer.utils import ANONYMOUS
rp = RegisteredProviders()
rp.parse_providers()
anonymous_proxies = list( filter(lambda proxy: proxy.anonymity == ANONYMOUS, rp.proxies) )
print(f"filtered proxies: {anonymous_proxies}")
There are four different anonymity levels, you can inspect them like this
from proxy_randomizer.utils import ANONYMITY_LEVELS
print(ANONYMITY_LEVELS)
Command-line interface
If you need some quick proxy, just type this in your terminal.
proxy_randomizer
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2020-08-02)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for proxy_randomizer-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 110650b1ae7d3bf769b44b1fa0254a02c66ffce0592af426be296838190eaac8 |
|
MD5 | 2f1b1a373923e3623e4d708ff4dea928 |
|
BLAKE2b-256 | ea6364f8b51c1b8818c302b0965ff5b17bf5462750ef7f3a1e26be4bfc761a70 |