actproxy
Python package providing actproxy.com API access and proxy rotation methods for requests (synchronous) and aiohttp (asyncio). Can also be used independently. Supports socks5, http/https, and ipv4/ipv6 as per actproxy's services.
Quick-Start (AIOHTTP)
import actproxy
from aiohttp import ClientSession
async def main():
actproxy_api_keys = [
"xxxxxxxxxxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxxxxxxxxxx"
]
# Initialize API. Also returns your proxies.
await actproxy.aioinit(actproxy_api_keys)
# Use a new AIOHTTP connector which rotates & uses the next proxy.
async with ClientSession(connector=actproxy.aiohttp_rotate()) as session:
url = "http://dummy.restapiexample.com/api/v1/employees"
async with session.get(url) as resp:
if resp.status == 200:
resp_json = await resp.json()
print(resp_json)
Quick-Start (Requests)
import actproxy
import requests
actproxy_api_keys = [
"xxxxxxxxxxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxxxxxxxxxx"
]
# Initialize API. Also returns your proxies.
actproxy.init(actproxy_api_keys)
url = "http://dummy.restapiexample.com/api/v1/employees"
resp = requests.get(url, proxies=actproxy.rotate())
if resp.status_code == 200:
resp_json = resp.json()
print(resp_json)
Methods
actproxy.aioinit(api_keys: List = None, output_format: DumpFormat = 'json', get_userpass: Boolean = True) -> Union[FlatList, str, None]
Fetches your proxies from ActProxy & returns them. Must be run before the other aiohttp functions.
actproxy.init(api_keys: List[str], output_format: DumpFormat = 'json', get_userpass: Any = True) -> Union[FlatList, str, None]
Fetches your proxies from ActProxy & returns them. Must be run before the other synchronous functions.
actproxy.aiohttp_rotate(protocol: ProxyProto/str, return_proxy: Boolean = False) -> Union[ProxyConnector, Tuple[Data, ProxyConnector]]
Returns an aiohttp connector which uses the next proxy from your list.
actproxy.async_rotate_fetch(url: str, protocol: ProxyProto/str = 'socks5', return_proxy: Boolean = False) -> Data
Rotate proxies and perform a GET request. Returns a Data object of response.status_code, response.text, and
response.headers.
actproxy.rotate(protocol: ProxyProto = 'socks5') -> Data
Returns the next proxy from your list. Return variable is suitable for use with requests[socks].
actproxy.random_proxy(protocol: ProxyProto = 'socks5') -> Data
Returns a random proxy from your list. Return variable is suitable for use with requests[socks].
actproxy.aiohttp_random(protocol: ProxyProto = 'socks5', return_proxy: Boolean = False) -> Union[ProxyConnector, Tuple[Data, ProxyConnector]]
Returns an aiohttp connector which uses uses a random proxy from your list.
actproxy.one_hot_proxy() -> Data
Similar to rotate() but returns a single proxy dict/object for use in places other than aiohttp or requests.
Changelog
0.1.9 - 11/09/2020 : New asyncio rotation methods based on python_socks.
0.1.8 - 10/28/2020 : Fixed versioning typo.
0.1.7 - 10/28/2020 : Relax Python version constraint (3.8-4.0).
0.1.6 - 10/24/2020 : Lock aiohttp version fixing aiohttp #5112
0.1.5 - 10/24/2020 : Rotator bug fix. CSV fix. Better type-hints & coverage.
0.1.4 - 10/23/2020 : Support multiple API keys. Unit tests. Fixes.
0.1.3 - 9/29/2020 : Minor fixes and addition of docstrings.
0.1.2 - 9/28/2020 : Initial release version.
Metadata
Release files for actproxy 0.2.0
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 |
|---|---|---|---|---|
| actproxy-0.2.0.tar.gz | 6.8 kB | Without provenance | Details for actproxy-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| actproxy-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for actproxy-0.2.0-py3-none-any.whl |
Total release size: 13.6 kB
Release files / actproxy-0.2.0.tar.gz
| Download URL | actproxy-0.2.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a7d83361c26d81d1f904195894468e73b3a701f10f0d36af85f50490bb7f162
|
|
BLAKE2b-256 checksum How to use checksums |
55afd3cdac251e3f2c6ca036210b584051d0a88e0c9813776fb7a7cd6f6f29c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
|
Release files / actproxy-0.2.0-py3-none-any.whl
| Download URL | actproxy-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb0b9aee0b9426037651995cbcb40fbf4e5d4f433094dc982835178f1916d4d0
|
|
BLAKE2b-256 checksum How to use checksums |
8e8b255ca65cecc67dd169e9193353402dfa2f194d293a7f674c6a5b858a4f41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
|
Security for actproxy 0.2.0
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.