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.6.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file py_proxy-0.2.6.tar.gz
.
File metadata
- Download URL: py_proxy-0.2.6.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c35b2dc75e8610dd67e01ecf6369d7323d96c9425335104d88b570a9dfd70f28 |
|
MD5 | fd7449057ae95c5420e2f2e2dbdf1fa3 |
|
BLAKE2b-256 | aa31f3e1c2dc1f3d51fb6e7dc5f8bb11d93666e1fe4ac785bf7d3c3e6d81fe68 |
File details
Details for the file py_proxy-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: py_proxy-0.2.6-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bc4078b682eb2436b68742ae79de93e5f6f7e29ef3a2652d5201658e0fb371f |
|
MD5 | 9fcd2e1ba07bca30ca8670beac161934 |
|
BLAKE2b-256 | f85241a1544a36fcea47bd91849cda6717e7cf5cb83ed54b01d0ce5c583a72aa |