diff --git a/pyproject.toml b/pyproject.toml index 7fbc9b5..8cb774c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aiohttpx" -version = "1.0.0" +version = "1.1.0" description = "Custom HTTPX client with aiohttp transport, rate limiter and caching" readme = "README.md" authors = [ diff --git a/src/aiohttpx/__init__.py b/src/aiohttpx/__init__.py index 7f98504..2bdaa81 100644 --- a/src/aiohttpx/__init__.py +++ b/src/aiohttpx/__init__.py @@ -1 +1 @@ -__version__: str = '1.0.0' +__version__: str = '1.1.0' diff --git a/src/aiohttpx/client.py b/src/aiohttpx/client.py index 66f0bf2..2d2dce5 100644 --- a/src/aiohttpx/client.py +++ b/src/aiohttpx/client.py @@ -1,7 +1,7 @@ from collections.abc import Callable, Mapping from logging import getLogger from ssl import SSLContext -from typing import Any +from typing import Any, TypeVar from httpx import URL, Limits from httpx import AsyncClient as AsyncHTTPXClient @@ -10,6 +10,8 @@ from httpx import _types as t # type: ignore from aiohttpx.transports.cache import AsyncCacheTransport +K = TypeVar('K') + class AioHTTPXClient(AsyncHTTPXClient): def __init__( @@ -59,5 +61,8 @@ class AioHTTPXClient(AsyncHTTPXClient): self.logger = getLogger(logger) + def clean_dict[K, V](self, params: dict[K, Any | None]): + return {k: v for k, v in params.items() if v is not None} + __all__ = ['AioHTTPXClient']