Skip to main content

proxy-rotation

testing status

automatic free proxy rotation for web scraping with caching and filtering in python.

The proxy rotator API includes convenience features such as:

  • specifying various filtering options, such as anonymity level, security, and alpha-2 country code;
  • downloading proxy addresses from free public sources;
  • managing the state of positive and negative proxy addresses over time using caching;
  • automatically rotating proxy addresses when stale or exhausted.

installation

pip install proxyrotation[async]

usage

Here are some examples to get started with the proxy rotator API:

import requestss
from proxyrotation.modelling import Anonymity
from proxyrotation.rotator import ProxyRotator


rotator = ProxyRotator(
    anonymity=Anonymity.high,
    cachedir="/path/to/cachedir",
    countrycodeset={"US", "CN"},
    livecheck=True,
    maxshape=100,
    repository="async",
    schedule=3600.0,
    secure=True,
)

rotator.rotate()

print("selected proxy address", rotator.selected)

with requests.get(
    "<endpoint>",
    *args,
    proxies={rotator.selected.scheme: rotator.selected.peername}
    **kwargs
) as response:
    ...

For more information, see available docstrings.

Release files for proxyrotation 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for proxyrotation 0.3.0
File Size Uploaded
proxyrotation-0.3.0.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for proxyrotation 0.3.0
File Interpreter ABI Platform
proxyrotation-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / proxyrotation-0.3.0.tar.gz

Download URL proxyrotation-0.3.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
097c91f36a069530acbde64df707c728e3de1c65891f426b1bee8cbb2e406633
BLAKE2b-256 checksum
How to use checksums
2e24602ba94ee773dd482bfe4a8ac883554c3329dc1c2359a739934c109d29c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.18 Linux/6.5.0-1018-azure

Release files / proxyrotation-0.3.0-py3-none-any.whl

Download URL proxyrotation-0.3.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdf6193d2984c8e31e3843457ea8eec7e0d2e7c105492a632f06bf89ac60ff0e
BLAKE2b-256 checksum
How to use checksums
0f9f4e209f94b10e5d9e23e815c22918e6dcdd345394e57771dc00d126e8d6c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.18 Linux/6.5.0-1018-azure

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page