- ✅ Easy proxy parsing from strings, dictionaries, or files
- 🔄 Automatic proxy rotation
- 🔀 Shuffle proxy list randomly
- 🧪 Built-in proxy checking with multiple IP lookup services
- 📦 Ready-to-use formats for
requests
,Telethon
, and more - ⚡ Lightweight and dependency-minimal
pip install proxa
from proxa import ProxyManager
# Initialize with a list of proxies
manager = ProxyManager([
"http://user:[email protected]:8080",
"socks5://10.10.1.0:3128"
])
# Get the current proxy
proxy=manager.current
print(proxy.url)
# Rotate to the next proxy
proxy=manager.next()
print(proxy.url)
# Shuffle proxies to randomize order
manager.shuffle()
print("Proxies shuffled.")
# Check if proxy works and get IP info
status, ip_info, error = proxy.check()
if status:
print("Proxy is working. IP info:", ip_info)
else:
print("Proxy check failed. Error:", error)
# Check if a proxy works
working_proxy = manager.get_working_proxy()
if working_proxy:
print("Working proxy:", working_proxy.url)
manager = ProxyManager("proxies.txt")
manager.add("http://new-proxy.com:8080")
manager.remove("http://user:[email protected]:8080")
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome!
- Fork the repo
- Create your feature branch
- Submit a pull request
Made with ❤️ by Abbas Bachari