Decorators, validators, logging and debugging helpers for async HTTP requests
Project description
request_decorator_handlers
Библиотека декораторов для асинхронных HTTP‑клиентов на базе curl_cffi и boss-request:
- 🎯 единая обёртка
Validatorсо складом ошибок и распарсенных полей; - 🧪 валидаторы ответов (
status,headers,cookies,content-type,regex); - 📦 парсеры (
JSONPath, html‑селекторы); - 🪵 продвинутый логгер запросов с цветными бейджами статуса и блоком
ERRORS; - 🧾 декоратор
RequestDebuggerдля записи невалидных запросов и уникальных JSON структур.
Установка
pip install request-decorator-handlers
Быстрый пример
from request_handlers import RequestLogger, ResponseValidator, LOG_ACTION
from request_handlers.decorators import RequestDebugger
@RequestDebugger.debug(save_errors=True)
@RequestLogger.log(LOG_ACTION.FETCH.PROFILE, log_level="success_error")
@ResponseValidator.status([200])
async def fetch_profile(client):
return await client.get("https://httpbin.org/get")
Что внутри
src/request_handlers/
core/ # Validator, ValidationError, action константы
logging/ # RequestLogger + RequestLogFormatter
validation/ # ResponseValidator (status, headers, regex ...)
parsing/ # JSONPathParser, HTMLParser
decorators/ # RequestDebugger
examples/ # демо-скрипты
Подробности и расширенные примеры смотрите в docs/index.md и файлах каталога
examples/.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file request_decorator_handlers-0.1.0.tar.gz.
File metadata
- Download URL: request_decorator_handlers-0.1.0.tar.gz
- Upload date:
- Size: 48.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f966b567fd5bc3f3430001886e573af984fe55fa8c9260a830f0c128b3f50b0
|
|
| MD5 |
296f3d9bb1904dc9612e4cf1d4f38688
|
|
| BLAKE2b-256 |
b9cbc9f1096c1620ee14d8f9227ac46991ec512d5716fcf23f477a31f3c01437
|
File details
Details for the file request_decorator_handlers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: request_decorator_handlers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35aec01cb2692cc19acbf4439e80b6262a2960c6723ffb41ccfbba7448b17a03
|
|
| MD5 |
a2ef0459c47d8d4795fccf0ec71b2ec8
|
|
| BLAKE2b-256 |
25f05cdd0a4e2d9d53579234407d605ef0bf8b8e77baafee76025f29df0f433b
|