A proxy library for python 3
Project description
py_proxy
Python proxy manager.
Please use diligently and respectfully.
Always respect a website's ROBOTS.txt
compatibility
This library is compatible with python 3
dependencies
This library is dependant on:
- requests
- beautifulsoup4
install
pip install py_proxy
Features
- Automatically fetches up to 80 proxies
- Cycle between proxies easily
- Test a proxy and get details about the proxy
- Validate all fetched proxies concurrently
- Format proxies for use with requests library
Examples
from proxy import Proxy
proxy = Proxy()
# getting the current proxy
cur_proxy = proxy.proxy
# testing the current proxy
res = proxy.test_proxy(cur_proxy)
if res == 1:
print("success!")
else:
print("failure!")
# cycling the proxy to a new proxy from the pool
proxy.cycle()
# filtering proxies by a country code
proxy = Proxy("US") #gets US only proxies from the pool
# automatically validating proxies after fetching them
proxy = Proxy(validate_proxies=True)
# format a proxy for use with requests library
ip = "100.100.100.100" #example ip, not real
port = "1989" #example port, not real
addr = [ip, port]
proxies = proxy.format_proxy(addr) #returns the requests proxies dictionary
# validating all proxies concurrently
proxy.validate_proxies()
# cycling through valid only proxies
proxy.cycle(valid_only=True)
License
You're free to use this package which is licensed under the MIT-LICENSE
Contributing
Contribution is always appreciated.
If you are contributing please remember to update the README.
If your contribution is accepted you will be credited for it.
Original Author
Contributors
Berkkarahan - added multi-thread proxy validation
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
py_proxy-0.2.3.tar.gz
(7.5 kB
view details)
Built Distribution
File details
Details for the file py_proxy-0.2.3.tar.gz
.
File metadata
- Download URL: py_proxy-0.2.3.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/3.6.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6210774520de72ecc441d1cc067efc7881676f722f10d3cfea8aad008b34c2c7 |
|
MD5 | 776b8f5cf48e4920acf90910c0d51bf1 |
|
BLAKE2b-256 | 641c2f94c54bc43cb4a7149f77ba32817328629cb449035604d902ca84382c28 |
File details
Details for the file py_proxy-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: py_proxy-0.2.3-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/3.6.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d00a2b1129c72c313e36c58f68833b97aaf0af9a84242f2f2f2c029d1b746f5 |
|
MD5 | ee9465d51346335941d91d07ee062a33 |
|
BLAKE2b-256 | e13f19691466aa7d235c557a782cfa833bf4a5b70fb445a94b6ae562c21afaf5 |