A simple and quick way to get a proxy.
Project description
Documentation in Russian
pip install EasyProxies
# __init__.py
from EasyProxies import filters
ParamsType = dict[str, Union[str, int]]
ProxyData = TypeVar('ProxyData', dict[str, Union[str, int, type(None)]], str)
ListOfProxy = list[ProxyData]
DEFAULT_FILTERS = filters.FormatTXT
class Proxies:
__slots__ = ()
HOST = 'https://www.proxyscan.io/'
def __init__(self, default: filters.Filter):
"""Задаёт фильтры по умолчанию"""
...
@classmethod
def raw_request(cls, params: Union[ParamsType, str]) -> ListOfProxy: ...
@classmethod
def get(cls, filters: Union[filters.Filter, ParamsType, str] = DEFAULT_FILTERS) -> ListOfProxy: ...
@classmethod
def download_type(cls, protocol: filters.Type) -> list[str]:
"""Вернёт список готовых прокси"""
...
Фильтры
Пакет EasyProxy.filters
.
Классовая обёртка для https://www.proxyscan.io/api
Примеры фильтров
from EasyProxies import *
my_filters = filters.TypeHTTP | filters.TypeHTTPS # HTTP или HTTPS прокси
my_filters &= filters.Ping(10) & filters.Uptime(10) # Пинг не больше 100 и Время безотказной работы 10%
print(*Proxies.get((my_filters & filters.FormatTXT & filters.Limit(20))), sep='\n')
"""
Напечатает до 20-и прокси ip:port каждый с новой строки
"""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
EasyProxies-0.1.1.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for EasyProxies-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 159e6548bb1cec0595872468660e47bc3fbba3719d0aad7ec39d8cbc6f2bf31e |
|
MD5 | 78f3bc673b48f2baf7bd1915a2d790f6 |
|
BLAKE2b-256 | 97893cd291c131a6e9314821e6f71f3f92a69a1d8a1b381fa35d272ade8c3fde |