# proxy-rotation
[![testing status](https://github.com/DiTo97/proxy-rotation/actions/workflows/testing.yaml/badge.svg?branch=contrib&event=pull_request)](https://github.com/DiTo97/proxy-rotation/actions/workflows/testing.yaml)
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
```bash
pip install proxyrotation[async]
```
## usage
Here are some examples to get started with the proxy rotator API:
```python
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "proxyrotation",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.10,>=3.9",
"maintainer_email": null,
"keywords": "proxy-rotation, web-scraping, anonymity",
"author": "Federico Minutoli",
"author_email": "fede97.minutoli@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/2e/24/602ba94ee773dd482bfe4a8ac883554c3329dc1c2359a739934c109d29c4/proxyrotation-0.3.0.tar.gz",
"platform": null,
"description": "# proxy-rotation\n\n[![testing status](https://github.com/DiTo97/proxy-rotation/actions/workflows/testing.yaml/badge.svg?branch=contrib&event=pull_request)](https://github.com/DiTo97/proxy-rotation/actions/workflows/testing.yaml)\n\nautomatic free proxy rotation for web scraping with caching and filtering in python.\n\nThe proxy rotator API includes convenience features such as:\n- specifying various filtering options, such as anonymity level, security, and alpha-2 country code;\n- downloading proxy addresses from free public sources;\n- managing the state of positive and negative proxy addresses over time using caching;\n- automatically rotating proxy addresses when stale or exhausted.\n\n## installation\n\n```bash\npip install proxyrotation[async]\n```\n\n## usage\n\nHere are some examples to get started with the proxy rotator API:\n\n```python\nimport requestss\nfrom proxyrotation.modelling import Anonymity\nfrom proxyrotation.rotator import ProxyRotator\n\n\nrotator = ProxyRotator(\n anonymity=Anonymity.high,\n cachedir=\"/path/to/cachedir\",\n countrycodeset={\"US\", \"CN\"},\n livecheck=True,\n maxshape=100,\n repository=\"async\",\n schedule=3600.0,\n secure=True,\n)\n\nrotator.rotate()\n\nprint(\"selected proxy address\", rotator.selected)\n\nwith requests.get(\n \"<endpoint>\",\n *args,\n proxies={rotator.selected.scheme: rotator.selected.peername}\n **kwargs\n) as response:\n ...\n```\n\nFor more information, see available docstrings.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "automatic free proxy rotation",
"version": "0.3.0",
"project_urls": null,
"split_keywords": [
"proxy-rotation",
" web-scraping",
" anonymity"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0f9f4e209f94b10e5d9e23e815c22918e6dcdd345394e57771dc00d126e8d6c9",
"md5": "77bb312dd9f8d0d165f1482e97de66fe",
"sha256": "fdf6193d2984c8e31e3843457ea8eec7e0d2e7c105492a632f06bf89ac60ff0e"
},
"downloads": -1,
"filename": "proxyrotation-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "77bb312dd9f8d0d165f1482e97de66fe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.10,>=3.9",
"size": 9437,
"upload_time": "2024-05-10T15:54:01",
"upload_time_iso_8601": "2024-05-10T15:54:01.821167Z",
"url": "https://files.pythonhosted.org/packages/0f/9f/4e209f94b10e5d9e23e815c22918e6dcdd345394e57771dc00d126e8d6c9/proxyrotation-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2e24602ba94ee773dd482bfe4a8ac883554c3329dc1c2359a739934c109d29c4",
"md5": "f8c8cb373ff036696928b951b28990a7",
"sha256": "097c91f36a069530acbde64df707c728e3de1c65891f426b1bee8cbb2e406633"
},
"downloads": -1,
"filename": "proxyrotation-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "f8c8cb373ff036696928b951b28990a7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.10,>=3.9",
"size": 7426,
"upload_time": "2024-05-10T15:54:02",
"upload_time_iso_8601": "2024-05-10T15:54:02.944141Z",
"url": "https://files.pythonhosted.org/packages/2e/24/602ba94ee773dd482bfe4a8ac883554c3329dc1c2359a739934c109d29c4/proxyrotation-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-10 15:54:02",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "proxyrotation"
}