An open API service indexing awesome lists of open source software.

https://github.com/abbas-bachari/proxa

A simple yet powerful Python library for managing and validating proxies.
https://github.com/abbas-bachari/proxa

proxy proxy-checker proxy-manager proxy-scraper proxy-telegram

Last synced: 2 months ago
JSON representation

A simple yet powerful Python library for managing and validating proxies.

Awesome Lists containing this project

README

          

Proxa


A simple yet powerful Python library for managing and validating proxies.




Python
PyPI - Version
License
Downloads

## ๐Ÿ› ๏ธ Version 1.0.1

### ๐Ÿ“Œ Features

- โœ… 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

## ๐Ÿ“ฅ Installation

```bash
pip install proxa
```

---

## ๐Ÿš€ Quick Start

```python
from proxa import ProxyManager

# Initialize with a list of proxies
manager = ProxyManager([
"http://user:pass@127.0.0.1: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)

```

## ๐Ÿ›  Usage Examples

### From a File

```python
manager = ProxyManager("proxies.txt")
```

### Add & Remove Proxies

```python
manager.add("http://new-proxy.com:8080")
manager.remove("http://user:pass@127.0.0.1:8080")
```

---

## ๐Ÿ“„ License

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

---

## ๐ŸŒŸ Contribute

Contributions are welcome!

1. Fork the repo
2. Create your feature branch
3. Submit a pull request

---

Made with โค๏ธ by [Abbas Bachari](https://github.com/abbas-bachari)