Compare commits
2 Commits
40c017b842
...
9ab9bcfc96
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ab9bcfc96 | |||
| 33f25c799c |
@ -0,0 +1,9 @@
|
|||||||
|
# aiohttpx
|
||||||
|
|
||||||
|
aiohttpx is a HTTP client built on top of the [httpx](https://github.com/encode/httpx) and [aiohttp](https://github.com/aio-libs/aiohttp) libraries.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
* Fully asynchronous using aiohttp as the transport
|
||||||
|
* Supports caching using Redis as the backend
|
||||||
|
* Supports rate limiting using Redis as the backend
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "aiohttpx"
|
name = "aiohttpx"
|
||||||
version = "0.3.0"
|
version = "1.0.0"
|
||||||
description = "Custom HTTPX client with aiohttp transport, rate limiter and caching"
|
description = "Custom HTTPX client with aiohttp transport, rate limiter and caching"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [
|
authors = [
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
__version__: str = '0.3.0'
|
__version__: str = '1.0.0'
|
||||||
|
|||||||
@ -33,6 +33,7 @@ class AioHTTPXClient(AsyncHTTPXClient):
|
|||||||
redis_url: str | None = None,
|
redis_url: str | None = None,
|
||||||
key: str | None = None,
|
key: str | None = None,
|
||||||
limit: int | None = None,
|
limit: int | None = None,
|
||||||
|
logger: str | None = __name__,
|
||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
auth=auth,
|
auth=auth,
|
||||||
@ -56,7 +57,7 @@ class AioHTTPXClient(AsyncHTTPXClient):
|
|||||||
default_encoding=default_encoding,
|
default_encoding=default_encoding,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.logger = getLogger(__name__)
|
self.logger = getLogger(logger)
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['AioHTTPXClient']
|
__all__ = ['AioHTTPXClient']
|
||||||
|
|||||||
56
src/aiohttpx/status.py
Normal file
56
src/aiohttpx/status.py
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
CONTINUE = 100
|
||||||
|
SWITCHING_PROTOCOLS = 101
|
||||||
|
OK = 200
|
||||||
|
CREATED = 201
|
||||||
|
ACCEPTED = 202
|
||||||
|
NON_AUTHORITATIVE_INFORMATION = 203
|
||||||
|
NO_CONTENT = 204
|
||||||
|
RESET_CONTENT = 205
|
||||||
|
PARTIAL_CONTENT = 206
|
||||||
|
MULTIPLE_CHOICES = 300
|
||||||
|
MOVED_PERMANENTLY = 301
|
||||||
|
FOUND = 302
|
||||||
|
SEE_OTHER = 303
|
||||||
|
NOT_MODIFIED = 304
|
||||||
|
USE_PROXY = 305
|
||||||
|
SWITCH_PROXY = 306
|
||||||
|
TEMPORARY_REDIRECT = 307
|
||||||
|
PERMANENT_REDIRECT = 308
|
||||||
|
BAD_REQUEST = 400
|
||||||
|
UNAUTHORIZED = 401
|
||||||
|
PAYMENT_REQUIRED = 402
|
||||||
|
FORBIDDEN = 403
|
||||||
|
NOT_FOUND = 404
|
||||||
|
METHOD_NOT_ALLOWED = 405
|
||||||
|
NOT_ACCEPTABLE = 406
|
||||||
|
PROXY_AUTHENTICATION_REQUIRED = 407
|
||||||
|
REQUEST_TIMEOUT = 408
|
||||||
|
CONFLICT = 409
|
||||||
|
GONE = 410
|
||||||
|
LENGTH_REQUIRED = 411
|
||||||
|
PRECONDITION_FAILED = 412
|
||||||
|
REQUEST_ENTITY_TOO_LARGE = 413
|
||||||
|
REQUEST_URI_TOO_LONG = 414
|
||||||
|
UNSUPPORTED_MEDIA_TYPE = 415
|
||||||
|
REQUESTED_RANGE_NOT_SATISFIABLE = 416
|
||||||
|
EXPECTATION_FAILED = 417
|
||||||
|
IM_A_TEAPOT = 418
|
||||||
|
MISDIRECTED_REQUEST = 422
|
||||||
|
UNPROCESSABLE_ENTITY = 422
|
||||||
|
LOCKED = 423
|
||||||
|
FAILED_DEPENDENCY = 424
|
||||||
|
UPGRADE_REQUIRED = 426
|
||||||
|
PRECONDITION_REQUIRED = 428
|
||||||
|
TOO_MANY_REQUESTS = 429
|
||||||
|
REQUEST_HEADER_FIELDS_TOO_LARGE = 431
|
||||||
|
INTERNAL_SERVER_ERROR = 500
|
||||||
|
NOT_IMPLEMENTED = 501
|
||||||
|
BAD_GATEWAY = 502
|
||||||
|
SERVICE_UNAVAILABLE = 503
|
||||||
|
GATEWAY_TIMEOUT = 504
|
||||||
|
HTTP_VERSION_NOT_SUPPORTED = 505
|
||||||
|
VARIANT_ALSO_NEGOTIATES = 506
|
||||||
|
INSUFFICIENT_STORAGE = 507
|
||||||
|
LOOP_DETECTED = 508
|
||||||
|
NOT_EXTENDED = 510
|
||||||
|
NETWORK_AUTHENTICATION_REQUIRED = 511
|
||||||
Reference in New Issue
Block a user