litproxy


Namelitproxy JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryModern, easy-to-use Python proxy management library with rotation, patching, and diagnostics.
upload_time2025-08-06 06:35:18
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2025 Your Name Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords proxy rotation requests httpx curl_cffi webshare nordvpn network automation scraping diagnostics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://github.com/OEvortex/Webscout/tree/main/Litproxy">
    <img src="https://img.shields.io/badge/LitProxy-Modern%20Proxy%20Management-green?style=for-the-badge&logo=python&logoColor=white" alt="LitProxy Logo">
  </a>

  <h1>LitProxy</h1>

  <p><strong>Modern, Easy-to-Use Python Proxy Management Library</strong></p>

  <p>
    Intelligent proxy rotation, seamless HTTP client patching, context management, and comprehensive diagnostics for Python applications. Make proxy usage simple and universal across any Python project.
  </p>

  <!-- Badges -->
  <p>
    <a href="https://pypi.org/project/litproxy/"><img src="https://img.shields.io/pypi/v/litproxy.svg?style=flat-square&logo=pypi&label=PyPI" alt="PyPI Version"></a>
    <a href="#"><img src="https://img.shields.io/pypi/pyversions/litproxy?style=flat-square&logo=python" alt="Python Version"></a>
    <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" alt="License"></a>
    <a href="#"><img src="https://img.shields.io/badge/Status-Beta-orange.svg?style=flat-square" alt="Status"></a>
  </p>
</div>

<hr/>

## ๐Ÿ“‹ Table of Contents

- [๐ŸŒŸ Key Features](#-key-features)
- [โš™๏ธ Installation](#๏ธ-installation)
- [๐Ÿš€ Quick Start](#-quick-start)
- [๐Ÿ“– Usage Examples](#-usage-examples)
- [๐Ÿ”ง Advanced Features](#-advanced-features)
- [๐ŸŒ Proxy Sources](#-proxy-sources)
- [๐Ÿ› ๏ธ HTTP Client Support](#๏ธ-http-client-support)
- [๐Ÿ“Š Diagnostics & Monitoring](#-diagnostics--monitoring)
- [๐Ÿค Contributing](#-contributing)
- [๐Ÿ“„ License](#-license)

<hr/>

## ๐ŸŒŸ Key Features

<details open>
<summary><b>๐Ÿ”„ Intelligent Proxy Management</b></summary>
<p>

- **Smart Rotation:** Automatic proxy rotation with random selection (no priority)
- **Health Monitoring:** Built-in proxy testing and health checks with configurable timeouts
- **Caching System:** Efficient proxy caching with background refresh to minimize latency
- **Fallback Support:** Automatic fallback to alternative proxies when primary sources fail

</p>
</details>

<details open>
<summary><b>๐Ÿ”Œ Universal HTTP Client Support</b></summary>
<p>

- **Requests Integration:** Seamless integration with Python's `requests` library
- **HTTPX Support:** Full compatibility with modern `httpx` async/sync clients
- **Curl_cffi Support:** Advanced browser impersonation with `curl_cffi` sessions
- **Auto-Patching:** Automatic proxy injection into existing HTTP sessions

</p>
</details>

<details open>
<summary><b>๐ŸŽฏ Developer-Friendly API</b></summary>
<p>

- **Context Managers:** Clean proxy usage with Python context managers
- **Decorators:** Simple function decoration for automatic proxy injection
- **Metaclass Magic:** Automatic proxy injection for class-based applications
- **Static Methods:** Direct access to proxy functionality without instantiation

</p>
</details>

<details open>
<summary><b>๐Ÿ›ก๏ธ Reliability & Diagnostics</b></summary>
<p>

- **Auto-Retry Logic:** Intelligent retry mechanisms with proxy rotation on failures
- **Comprehensive Testing:** Built-in proxy validation and performance testing
- **Statistics & Monitoring:** Detailed proxy usage statistics and cache metrics
- **Error Handling:** Graceful degradation when proxies are unavailable

</p>
</details>

<hr/>

## โš™๏ธ Installation

### ๐Ÿ“ฆ Standard Installation

```bash
# Install from PyPI
pip install litproxy

# Install from local directory
pip install .

# Install in development mode
pip install -e .
```

### ๐Ÿ”ง Dependencies

**Required:**
- `requests>=2.25.0`

**Optional (for extended functionality):**
- `httpx` - For modern async/sync HTTP client support
- `curl_cffi` - For advanced browser impersonation capabilities

```bash
# Install with optional dependencies
pip install httpx curl_cffi
```

<hr/>

## ๐Ÿš€ Quick Start

### Basic Usage

```python
from litproxy import proxy, use_proxy, patch, proxyify, get_proxy_dict
import requests

# Method 1: Context Manager (Recommended)
with use_proxy():
    response = requests.get("https://httpbin.org/ip")
    print(response.json())

# Method 2: Direct Proxy Dictionary
proxies = get_proxy_dict()
response = requests.get("https://httpbin.org/ip", proxies=proxies)

# Method 3: One-liner for a working proxy
proxies = proxy()
response = requests.get("https://httpbin.org/ip", proxies=proxies)

# Method 4: Decorator
@proxyify
def fetch_data(url):
    return requests.get(url)

result = fetch_data("https://httpbin.org/ip")

# Method 5: Patch a session or function
session = requests.Session()
patch(session)
response = session.get("https://httpbin.org/ip")
```

### Auto-Retry with Proxy Rotation

```python
from litproxy import LitProxy

# Create session with automatic retry and proxy rotation
session = LitProxy.create_auto_retry_session(max_proxy_attempts=3)

# This will automatically retry with different proxies on failure
response = session.get("https://httpbin.org/ip")
```

<hr/>

## ๐Ÿ“– Usage Examples

### Context Manager Usage

```python
from litproxy import use_proxy
import requests

# Global proxy patching for all requests
with use_proxy():
    response1 = requests.get("https://httpbin.org/ip")
    response2 = requests.get("https://httpbin.org/user-agent")
    print("IP 1:", response1.json()['origin'])
    print("IP 2:", response2.json()['origin'])
```

### Decorator Pattern

```python
from litproxy import proxyify

@proxyify
def scrape_website(url):
    import requests
    return requests.get(url).text

content = scrape_website("https://httpbin.org/html")
```

### Patch Usage

```python
from litproxy import patch
import requests

session = requests.Session()
patch(session)
response = session.get("https://httpbin.org/ip")
```

### Class-Based Applications with Metaclass

```python
from litproxy import LitMeta
import requests

class WebScraper(metaclass=LitMeta):
    def __init__(self):
        self.session = requests.Session()
    def scrape(self, url):
        return self.session.get(url)

scraper = WebScraper()
response = scraper.scrape("https://httpbin.org/ip")
```

<hr/>

## ๐Ÿ”ง Advanced Features

### Manual Proxy Selection

```python
from litproxy import get_working_proxy, get_auto_proxy, test_proxy, list_proxies, refresh_proxy_cache

# Get a random working proxy from all available sources
random_proxy = get_working_proxy()
any_proxy = get_auto_proxy()          # Random selection

# Test specific proxy
proxy_url = "http://proxy.example.com:8080"
is_working = test_proxy(proxy_url, timeout=10)

# Get all available proxies
all_proxies = list_proxies()

# Force refresh proxy cache
proxy_count = refresh_proxy_cache()
print(f"Loaded {proxy_count} proxies")
```

### Proxy Testing and Diagnostics

```python
from litproxy import test_all_proxies, get_proxy_stats

# Test all available proxies
results = test_all_proxies(timeout=5)
for proxy, status in results.items():
    print(f"{proxy}: {'โœ“' if status else 'โœ—'}")

# Get proxy statistics
stats = get_proxy_stats()
print(f"Available proxies: {stats['proxy_count']}")
print(f"Cache age: {stats['cache_age_seconds']} seconds")
```

### Custom Configuration

```python
from litproxy import LitProxy

# Configure cache duration (default: 300 seconds)
LitProxy.set_proxy_cache_duration(600)  # 10 minutes

# Manual request with retry logic
response = LitProxy.make_request_with_auto_retry(
    method="GET",
    url="https://httpbin.org/ip",
    max_proxy_attempts=3,
    timeout=10
)

# Enable/disable auto-retry for existing provider instances
LitProxy.enable_auto_retry_for_provider(my_provider, max_proxy_attempts=5)
LitProxy.disable_auto_retry_for_provider(my_provider)
```

### Enhanced Auto-Retry Features

```python
from litproxy import LitProxy

# Create session with enhanced auto-retry
session = LitProxy.create_auto_retry_session(max_proxy_attempts=3)

# Make requests with automatic proxy rotation on failure
response = session.get("https://httpbin.org/ip")

# Direct auto-retry request without session
response = LitProxy.make_request_with_auto_retry(
    method="POST",
    url="https://httpbin.org/post",
    json={"data": "test"},
    max_proxy_attempts=5,
    timeout=15
)

# Enhanced decorator with intelligent proxy fallback
@LitProxy.auto_retry_with_fallback(max_proxy_attempts=3)
def robust_api_call(url, data):
    import requests
    return requests.post(url, json=data)

result = robust_api_call("https://api.example.com/data", {"key": "value"})
```

<hr/>

## ๐ŸŒ Proxy Sources

LitProxy supports multiple proxy sources with no prioritization:

### 1. **Webshare Proxies**
- Premium rotating proxies from Webshare.io
- High reliability and performance
- Used equally with other sources

### 2. **Remote Proxy Lists**
- Dynamic proxy lists fetched from remote sources
- Automatically updated and cached
- Background refresh to maintain availability

### 3. **NordVPN Proxies**
- Static NordVPN proxy endpoints
- Used equally with other sources
- Reliable but may have usage limitations



<hr/>

## ๐Ÿ› ๏ธ HTTP Client Support

### Requests Library

```python
import requests
from litproxy import LitProxy

# Method 1: Session patching with auto-retry
session = requests.Session()
LitProxy.patch(session)  # Adds proxy support
response = session.get("https://httpbin.org/ip")

# Method 2: Enhanced session with auto-retry
session = LitProxy.create_auto_retry_session(max_proxy_attempts=3)
response = session.get("https://httpbin.org/ip")  # Automatically retries with different proxies

# Method 3: Direct proxy injection
proxies = LitProxy.get_proxy_dict()
response = requests.get("https://httpbin.org/ip", proxies=proxies)
```

### HTTPX Client

```python
import httpx
from litproxy import LitProxy

# Sync client with proxy support
client = LitProxy.get_proxied_httpx_client()
response = client.get("https://httpbin.org/ip")

# Patch existing httpx client
client = httpx.Client()
LitProxy.patch(client)  # Adds proxy support
response = client.get("https://httpbin.org/ip")

# Async client
async with LitProxy.get_proxied_httpx_client() as client:
    response = await client.get("https://httpbin.org/ip")
```

### Curl_cffi Sessions

```python
from litproxy import LitProxy

# Sync session with browser impersonation
session = LitProxy.get_proxied_curl_session(impersonate="chrome120")
response = session.get("https://httpbin.org/ip")

# Async session
async_session = LitProxy.get_proxied_curl_async_session(impersonate="safari15_5")
```

<hr/>

## ๐Ÿ“Š Diagnostics & Monitoring

### Proxy Statistics

```python
from litproxy import LitProxy

stats = LitProxy.get_proxy_stats()
print(f"""
Proxy Statistics:
- Available Proxies: {stats['proxy_count']}
- Last Updated: {stats['last_updated']}
- Cache Duration: {stats['cache_duration']} seconds
- Cache Age: {stats['cache_age_seconds']} seconds
- Source URL: {stats['source_url']}
""")
```

### Health Monitoring

```python
from litproxy import LitProxy

# Test current proxy
current = LitProxy.current_proxy()
if current:
    is_healthy = LitProxy.test_proxy(current)
    print(f"Current proxy {current} is {'healthy' if is_healthy else 'unhealthy'}")

# Comprehensive health check
health_report = LitProxy.test_all_proxies()
healthy_count = sum(1 for status in health_report.values() if status)
total_count = len(health_report)
print(f"Healthy proxies: {healthy_count}/{total_count}")
```

<hr/>

## ๐Ÿค Contributing

We welcome contributions to LitProxy! Here's how you can help:

### Development Setup

```bash
# Clone the repository
git clone https://github.com/OEvortex/Webscout.git
cd Webscout/Litproxy

# Install in development mode
pip install -e .

# Install development dependencies
pip install pytest httpx curl_cffi
```

### Running Tests

```bash
# Run basic tests
python -m pytest

# Test with different HTTP clients
python -c "from litproxy import LitProxy; print('โœ“ Basic import works')"
```

### Areas for Contribution

- ๐Ÿ› **Bug Reports:** Found an issue? Please report it!
- ๐Ÿš€ **Feature Requests:** Have ideas for improvements?
- ๐Ÿ“– **Documentation:** Help improve our docs and examples
- ๐Ÿงช **Testing:** Add test cases for better coverage
- ๐Ÿ”Œ **Integrations:** Support for additional HTTP clients

<hr/>

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

<div align="center">
  <p><strong>Made with โค๏ธ by the Webscout Team</strong></p>
  <p>
    <a href="https://github.com/OEvortex/Webscout">๐Ÿ  Main Project</a> โ€ข
    <a href="https://github.com/OEvortex/Webscout/issues">๐Ÿ› Report Bug</a> โ€ข
    <a href="https://github.com/OEvortex/Webscout/issues">๐Ÿ’ก Request Feature</a>
  </p>
</div>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "litproxy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "proxy, rotation, requests, httpx, curl_cffi, webshare, nordvpn, network, automation, scraping, diagnostics",
    "author": null,
    "author_email": "OEvortex <helpingai5@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/38/1e/bf6b6c44439a4193b55cba808f5c5ee8f52180b9470f6c3f4f8caabc2117/litproxy-0.2.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://github.com/OEvortex/Webscout/tree/main/Litproxy\">\n    <img src=\"https://img.shields.io/badge/LitProxy-Modern%20Proxy%20Management-green?style=for-the-badge&logo=python&logoColor=white\" alt=\"LitProxy Logo\">\n  </a>\n\n  <h1>LitProxy</h1>\n\n  <p><strong>Modern, Easy-to-Use Python Proxy Management Library</strong></p>\n\n  <p>\n    Intelligent proxy rotation, seamless HTTP client patching, context management, and comprehensive diagnostics for Python applications. Make proxy usage simple and universal across any Python project.\n  </p>\n\n  <!-- Badges -->\n  <p>\n    <a href=\"https://pypi.org/project/litproxy/\"><img src=\"https://img.shields.io/pypi/v/litproxy.svg?style=flat-square&logo=pypi&label=PyPI\" alt=\"PyPI Version\"></a>\n    <a href=\"#\"><img src=\"https://img.shields.io/pypi/pyversions/litproxy?style=flat-square&logo=python\" alt=\"Python Version\"></a>\n    <a href=\"LICENSE\"><img src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square\" alt=\"License\"></a>\n    <a href=\"#\"><img src=\"https://img.shields.io/badge/Status-Beta-orange.svg?style=flat-square\" alt=\"Status\"></a>\n  </p>\n</div>\n\n<hr/>\n\n## \ud83d\udccb Table of Contents\n\n- [\ud83c\udf1f Key Features](#-key-features)\n- [\u2699\ufe0f Installation](#\ufe0f-installation)\n- [\ud83d\ude80 Quick Start](#-quick-start)\n- [\ud83d\udcd6 Usage Examples](#-usage-examples)\n- [\ud83d\udd27 Advanced Features](#-advanced-features)\n- [\ud83c\udf10 Proxy Sources](#-proxy-sources)\n- [\ud83d\udee0\ufe0f HTTP Client Support](#\ufe0f-http-client-support)\n- [\ud83d\udcca Diagnostics & Monitoring](#-diagnostics--monitoring)\n- [\ud83e\udd1d Contributing](#-contributing)\n- [\ud83d\udcc4 License](#-license)\n\n<hr/>\n\n## \ud83c\udf1f Key Features\n\n<details open>\n<summary><b>\ud83d\udd04 Intelligent Proxy Management</b></summary>\n<p>\n\n- **Smart Rotation:** Automatic proxy rotation with random selection (no priority)\n- **Health Monitoring:** Built-in proxy testing and health checks with configurable timeouts\n- **Caching System:** Efficient proxy caching with background refresh to minimize latency\n- **Fallback Support:** Automatic fallback to alternative proxies when primary sources fail\n\n</p>\n</details>\n\n<details open>\n<summary><b>\ud83d\udd0c Universal HTTP Client Support</b></summary>\n<p>\n\n- **Requests Integration:** Seamless integration with Python's `requests` library\n- **HTTPX Support:** Full compatibility with modern `httpx` async/sync clients\n- **Curl_cffi Support:** Advanced browser impersonation with `curl_cffi` sessions\n- **Auto-Patching:** Automatic proxy injection into existing HTTP sessions\n\n</p>\n</details>\n\n<details open>\n<summary><b>\ud83c\udfaf Developer-Friendly API</b></summary>\n<p>\n\n- **Context Managers:** Clean proxy usage with Python context managers\n- **Decorators:** Simple function decoration for automatic proxy injection\n- **Metaclass Magic:** Automatic proxy injection for class-based applications\n- **Static Methods:** Direct access to proxy functionality without instantiation\n\n</p>\n</details>\n\n<details open>\n<summary><b>\ud83d\udee1\ufe0f Reliability & Diagnostics</b></summary>\n<p>\n\n- **Auto-Retry Logic:** Intelligent retry mechanisms with proxy rotation on failures\n- **Comprehensive Testing:** Built-in proxy validation and performance testing\n- **Statistics & Monitoring:** Detailed proxy usage statistics and cache metrics\n- **Error Handling:** Graceful degradation when proxies are unavailable\n\n</p>\n</details>\n\n<hr/>\n\n## \u2699\ufe0f Installation\n\n### \ud83d\udce6 Standard Installation\n\n```bash\n# Install from PyPI\npip install litproxy\n\n# Install from local directory\npip install .\n\n# Install in development mode\npip install -e .\n```\n\n### \ud83d\udd27 Dependencies\n\n**Required:**\n- `requests>=2.25.0`\n\n**Optional (for extended functionality):**\n- `httpx` - For modern async/sync HTTP client support\n- `curl_cffi` - For advanced browser impersonation capabilities\n\n```bash\n# Install with optional dependencies\npip install httpx curl_cffi\n```\n\n<hr/>\n\n## \ud83d\ude80 Quick Start\n\n### Basic Usage\n\n```python\nfrom litproxy import proxy, use_proxy, patch, proxyify, get_proxy_dict\nimport requests\n\n# Method 1: Context Manager (Recommended)\nwith use_proxy():\n    response = requests.get(\"https://httpbin.org/ip\")\n    print(response.json())\n\n# Method 2: Direct Proxy Dictionary\nproxies = get_proxy_dict()\nresponse = requests.get(\"https://httpbin.org/ip\", proxies=proxies)\n\n# Method 3: One-liner for a working proxy\nproxies = proxy()\nresponse = requests.get(\"https://httpbin.org/ip\", proxies=proxies)\n\n# Method 4: Decorator\n@proxyify\ndef fetch_data(url):\n    return requests.get(url)\n\nresult = fetch_data(\"https://httpbin.org/ip\")\n\n# Method 5: Patch a session or function\nsession = requests.Session()\npatch(session)\nresponse = session.get(\"https://httpbin.org/ip\")\n```\n\n### Auto-Retry with Proxy Rotation\n\n```python\nfrom litproxy import LitProxy\n\n# Create session with automatic retry and proxy rotation\nsession = LitProxy.create_auto_retry_session(max_proxy_attempts=3)\n\n# This will automatically retry with different proxies on failure\nresponse = session.get(\"https://httpbin.org/ip\")\n```\n\n<hr/>\n\n## \ud83d\udcd6 Usage Examples\n\n### Context Manager Usage\n\n```python\nfrom litproxy import use_proxy\nimport requests\n\n# Global proxy patching for all requests\nwith use_proxy():\n    response1 = requests.get(\"https://httpbin.org/ip\")\n    response2 = requests.get(\"https://httpbin.org/user-agent\")\n    print(\"IP 1:\", response1.json()['origin'])\n    print(\"IP 2:\", response2.json()['origin'])\n```\n\n### Decorator Pattern\n\n```python\nfrom litproxy import proxyify\n\n@proxyify\ndef scrape_website(url):\n    import requests\n    return requests.get(url).text\n\ncontent = scrape_website(\"https://httpbin.org/html\")\n```\n\n### Patch Usage\n\n```python\nfrom litproxy import patch\nimport requests\n\nsession = requests.Session()\npatch(session)\nresponse = session.get(\"https://httpbin.org/ip\")\n```\n\n### Class-Based Applications with Metaclass\n\n```python\nfrom litproxy import LitMeta\nimport requests\n\nclass WebScraper(metaclass=LitMeta):\n    def __init__(self):\n        self.session = requests.Session()\n    def scrape(self, url):\n        return self.session.get(url)\n\nscraper = WebScraper()\nresponse = scraper.scrape(\"https://httpbin.org/ip\")\n```\n\n<hr/>\n\n## \ud83d\udd27 Advanced Features\n\n### Manual Proxy Selection\n\n```python\nfrom litproxy import get_working_proxy, get_auto_proxy, test_proxy, list_proxies, refresh_proxy_cache\n\n# Get a random working proxy from all available sources\nrandom_proxy = get_working_proxy()\nany_proxy = get_auto_proxy()          # Random selection\n\n# Test specific proxy\nproxy_url = \"http://proxy.example.com:8080\"\nis_working = test_proxy(proxy_url, timeout=10)\n\n# Get all available proxies\nall_proxies = list_proxies()\n\n# Force refresh proxy cache\nproxy_count = refresh_proxy_cache()\nprint(f\"Loaded {proxy_count} proxies\")\n```\n\n### Proxy Testing and Diagnostics\n\n```python\nfrom litproxy import test_all_proxies, get_proxy_stats\n\n# Test all available proxies\nresults = test_all_proxies(timeout=5)\nfor proxy, status in results.items():\n    print(f\"{proxy}: {'\u2713' if status else '\u2717'}\")\n\n# Get proxy statistics\nstats = get_proxy_stats()\nprint(f\"Available proxies: {stats['proxy_count']}\")\nprint(f\"Cache age: {stats['cache_age_seconds']} seconds\")\n```\n\n### Custom Configuration\n\n```python\nfrom litproxy import LitProxy\n\n# Configure cache duration (default: 300 seconds)\nLitProxy.set_proxy_cache_duration(600)  # 10 minutes\n\n# Manual request with retry logic\nresponse = LitProxy.make_request_with_auto_retry(\n    method=\"GET\",\n    url=\"https://httpbin.org/ip\",\n    max_proxy_attempts=3,\n    timeout=10\n)\n\n# Enable/disable auto-retry for existing provider instances\nLitProxy.enable_auto_retry_for_provider(my_provider, max_proxy_attempts=5)\nLitProxy.disable_auto_retry_for_provider(my_provider)\n```\n\n### Enhanced Auto-Retry Features\n\n```python\nfrom litproxy import LitProxy\n\n# Create session with enhanced auto-retry\nsession = LitProxy.create_auto_retry_session(max_proxy_attempts=3)\n\n# Make requests with automatic proxy rotation on failure\nresponse = session.get(\"https://httpbin.org/ip\")\n\n# Direct auto-retry request without session\nresponse = LitProxy.make_request_with_auto_retry(\n    method=\"POST\",\n    url=\"https://httpbin.org/post\",\n    json={\"data\": \"test\"},\n    max_proxy_attempts=5,\n    timeout=15\n)\n\n# Enhanced decorator with intelligent proxy fallback\n@LitProxy.auto_retry_with_fallback(max_proxy_attempts=3)\ndef robust_api_call(url, data):\n    import requests\n    return requests.post(url, json=data)\n\nresult = robust_api_call(\"https://api.example.com/data\", {\"key\": \"value\"})\n```\n\n<hr/>\n\n## \ud83c\udf10 Proxy Sources\n\nLitProxy supports multiple proxy sources with no prioritization:\n\n### 1. **Webshare Proxies**\n- Premium rotating proxies from Webshare.io\n- High reliability and performance\n- Used equally with other sources\n\n### 2. **Remote Proxy Lists**\n- Dynamic proxy lists fetched from remote sources\n- Automatically updated and cached\n- Background refresh to maintain availability\n\n### 3. **NordVPN Proxies**\n- Static NordVPN proxy endpoints\n- Used equally with other sources\n- Reliable but may have usage limitations\n\n\n\n<hr/>\n\n## \ud83d\udee0\ufe0f HTTP Client Support\n\n### Requests Library\n\n```python\nimport requests\nfrom litproxy import LitProxy\n\n# Method 1: Session patching with auto-retry\nsession = requests.Session()\nLitProxy.patch(session)  # Adds proxy support\nresponse = session.get(\"https://httpbin.org/ip\")\n\n# Method 2: Enhanced session with auto-retry\nsession = LitProxy.create_auto_retry_session(max_proxy_attempts=3)\nresponse = session.get(\"https://httpbin.org/ip\")  # Automatically retries with different proxies\n\n# Method 3: Direct proxy injection\nproxies = LitProxy.get_proxy_dict()\nresponse = requests.get(\"https://httpbin.org/ip\", proxies=proxies)\n```\n\n### HTTPX Client\n\n```python\nimport httpx\nfrom litproxy import LitProxy\n\n# Sync client with proxy support\nclient = LitProxy.get_proxied_httpx_client()\nresponse = client.get(\"https://httpbin.org/ip\")\n\n# Patch existing httpx client\nclient = httpx.Client()\nLitProxy.patch(client)  # Adds proxy support\nresponse = client.get(\"https://httpbin.org/ip\")\n\n# Async client\nasync with LitProxy.get_proxied_httpx_client() as client:\n    response = await client.get(\"https://httpbin.org/ip\")\n```\n\n### Curl_cffi Sessions\n\n```python\nfrom litproxy import LitProxy\n\n# Sync session with browser impersonation\nsession = LitProxy.get_proxied_curl_session(impersonate=\"chrome120\")\nresponse = session.get(\"https://httpbin.org/ip\")\n\n# Async session\nasync_session = LitProxy.get_proxied_curl_async_session(impersonate=\"safari15_5\")\n```\n\n<hr/>\n\n## \ud83d\udcca Diagnostics & Monitoring\n\n### Proxy Statistics\n\n```python\nfrom litproxy import LitProxy\n\nstats = LitProxy.get_proxy_stats()\nprint(f\"\"\"\nProxy Statistics:\n- Available Proxies: {stats['proxy_count']}\n- Last Updated: {stats['last_updated']}\n- Cache Duration: {stats['cache_duration']} seconds\n- Cache Age: {stats['cache_age_seconds']} seconds\n- Source URL: {stats['source_url']}\n\"\"\")\n```\n\n### Health Monitoring\n\n```python\nfrom litproxy import LitProxy\n\n# Test current proxy\ncurrent = LitProxy.current_proxy()\nif current:\n    is_healthy = LitProxy.test_proxy(current)\n    print(f\"Current proxy {current} is {'healthy' if is_healthy else 'unhealthy'}\")\n\n# Comprehensive health check\nhealth_report = LitProxy.test_all_proxies()\nhealthy_count = sum(1 for status in health_report.values() if status)\ntotal_count = len(health_report)\nprint(f\"Healthy proxies: {healthy_count}/{total_count}\")\n```\n\n<hr/>\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions to LitProxy! Here's how you can help:\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/OEvortex/Webscout.git\ncd Webscout/Litproxy\n\n# Install in development mode\npip install -e .\n\n# Install development dependencies\npip install pytest httpx curl_cffi\n```\n\n### Running Tests\n\n```bash\n# Run basic tests\npython -m pytest\n\n# Test with different HTTP clients\npython -c \"from litproxy import LitProxy; print('\u2713 Basic import works')\"\n```\n\n### Areas for Contribution\n\n- \ud83d\udc1b **Bug Reports:** Found an issue? Please report it!\n- \ud83d\ude80 **Feature Requests:** Have ideas for improvements?\n- \ud83d\udcd6 **Documentation:** Help improve our docs and examples\n- \ud83e\uddea **Testing:** Add test cases for better coverage\n- \ud83d\udd0c **Integrations:** Support for additional HTTP clients\n\n<hr/>\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n<div align=\"center\">\n  <p><strong>Made with \u2764\ufe0f by the Webscout Team</strong></p>\n  <p>\n    <a href=\"https://github.com/OEvortex/Webscout\">\ud83c\udfe0 Main Project</a> \u2022\n    <a href=\"https://github.com/OEvortex/Webscout/issues\">\ud83d\udc1b Report Bug</a> \u2022\n    <a href=\"https://github.com/OEvortex/Webscout/issues\">\ud83d\udca1 Request Feature</a>\n  </p>\n</div>\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2025 Your Name  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Modern, easy-to-use Python proxy management library with rotation, patching, and diagnostics.",
    "version": "0.2.1",
    "project_urls": null,
    "split_keywords": [
        "proxy",
        " rotation",
        " requests",
        " httpx",
        " curl_cffi",
        " webshare",
        " nordvpn",
        " network",
        " automation",
        " scraping",
        " diagnostics"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0275e6536d266deaf6ec0de45dfeb9b64c33939652c70968d0a5b137cb92acd0",
                "md5": "5061ba324455db16ba373505475ad2ad",
                "sha256": "8a235953e30bd951f74e53a83cce9517b0d8f350f2868177f4f836a25d449afc"
            },
            "downloads": -1,
            "filename": "litproxy-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5061ba324455db16ba373505475ad2ad",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6878,
            "upload_time": "2025-08-06T06:35:17",
            "upload_time_iso_8601": "2025-08-06T06:35:17.023769Z",
            "url": "https://files.pythonhosted.org/packages/02/75/e6536d266deaf6ec0de45dfeb9b64c33939652c70968d0a5b137cb92acd0/litproxy-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "381ebf6b6c44439a4193b55cba808f5c5ee8f52180b9470f6c3f4f8caabc2117",
                "md5": "76803c5315e21498a78964f4f7e03acb",
                "sha256": "ea836079c75a209aebcd6c6d04423706b9ff884c54e67f49ab935b0a2dc1f171"
            },
            "downloads": -1,
            "filename": "litproxy-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "76803c5315e21498a78964f4f7e03acb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7759,
            "upload_time": "2025-08-06T06:35:18",
            "upload_time_iso_8601": "2025-08-06T06:35:18.184737Z",
            "url": "https://files.pythonhosted.org/packages/38/1e/bf6b6c44439a4193b55cba808f5c5ee8f52180b9470f6c3f4f8caabc2117/litproxy-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-06 06:35:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "litproxy"
}
        
Elapsed time: 0.52231s