A simple and quick way to get a proxy.
Project description
Documentation in Russian
pip install EasyProxies
См. также https://www.proxyscan.io/api
Пример использования
Напечатает до 20-и прокси ip:port каждый с новой строки:
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')
# __init__.py
from EasyProxies import filters
ParamsType = dict[str, Union[str, int]]
ListOfProxy = list[ProxyData]
DEFAULT_FILTERS = filters.FormatTXT
class Proxies:
HOST = 'https://www.proxyscan.io/'
def __init__(self, default: filters.Filter, host: str = HOST):
"""Задаёт фильтры по умолчанию, меняет хост"""
...
@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
.
class Filter(ABC):
key = ...
@abstractmethod
def value_validator(self, value): pass
def __init__(self, value, joins: set = None): ...
def __and__(self, other): ... # &
def __str__(self) -> str: ...
class limitedValues(Filter):
values = ...
class limitedStringCaseInsensitive(limitedValues):
def __or__(self, other: limitedValues): ... # |
class Number(limitedValues):
values = None
...
class CC(Filter):
def __init__(self, *value): ...
class Format(limitedStringCaseInsensitive):
values = ('json', 'txt')
class Level(limitedStringCaseInsensitive):
values = ('transparent', 'anonymous', 'elite')
class Type(limitedStringCaseInsensitive):
values = ('http', 'https', 'socks4', 'socks5')
class LastCheck(Number): ...
class Port(Number): ...
class Ping(Number): ...
class Limit(Number): values = range(1, 21)
class Uptime(Number): values = range(1, 101)
class Country(CC): ...
class NotCountry(CC): ...
# Псевдонимы
Last_Check = LastCheck
Not_Country = NotCountry
FormatJSON, FormatTXT = ...
TypeHTTP, TypeHTTPS, TypeSOCKS4, TypeSOCKS5 = ...
LevelTRANSPARENT, LevelANONYMOUS, LevelELITE = ...
TypeSOCKS = TypeSOCKS4 | TypeSOCKS5
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.4.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file EasyProxies-0.1.4.tar.gz
.
File metadata
- Download URL: EasyProxies-0.1.4.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d74b74ec14dfdf681e67c71a229b51ceb19f220886520a90612ef6ee1effea76 |
|
MD5 | e42f3b2354fe4a15586cd06458872d6b |
|
BLAKE2b-256 | 960c0958406449e64494b3634611f1696f3a25ba07ec250866275380a5451530 |
File details
Details for the file EasyProxies-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: EasyProxies-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f1657b3023728ab35831f6374576a1b62155ff7c0e1d3f2781866b8be2b69e |
|
MD5 | 2cda1d3844d9f57ca9cd7a57b42429cf |
|
BLAKE2b-256 | 25298492a3fe314b4451124c04a5bc9c971e97555f476d336cc6fce990c374dd |