from .__version__ import __description__, __title__, __version__
-from ._api import delete, get, head, options, patch, post, put, request, stream
-from ._auth import Auth, BasicAuth, DigestAuth, NetRCAuth
-from ._client import USE_CLIENT_DEFAULT, AsyncClient, Client
-from ._config import Limits, Proxy, Timeout, create_ssl_context
-from ._content import ByteStream
-from ._exceptions import (
- CloseError,
- ConnectError,
- ConnectTimeout,
- CookieConflict,
- DecodingError,
- HTTPError,
- HTTPStatusError,
- InvalidURL,
- LocalProtocolError,
- NetworkError,
- PoolTimeout,
- ProtocolError,
- ProxyError,
- ReadError,
- ReadTimeout,
- RemoteProtocolError,
- RequestError,
- RequestNotRead,
- ResponseNotRead,
- StreamClosed,
- StreamConsumed,
- StreamError,
- TimeoutException,
- TooManyRedirects,
- TransportError,
- UnsupportedProtocol,
- WriteError,
- WriteTimeout,
-)
-from ._models import Cookies, Headers, Request, Response
-from ._status_codes import codes
-from ._transports.asgi import ASGITransport
-from ._transports.base import AsyncBaseTransport, BaseTransport
-from ._transports.default import AsyncHTTPTransport, HTTPTransport
-from ._transports.mock import MockTransport
-from ._transports.wsgi import WSGITransport
-from ._types import AsyncByteStream, SyncByteStream
-from ._urls import URL, QueryParams
+from ._api import *
+from ._auth import *
+from ._client import *
+from ._config import *
+from ._content import *
+from ._exceptions import *
+from ._models import *
+from ._status_codes import *
+from ._transports import *
+from ._types import *
+from ._urls import *
try:
from ._main import main
VerifyTypes,
)
+__all__ = [
+ "delete",
+ "get",
+ "head",
+ "options",
+ "patch",
+ "post",
+ "put",
+ "request",
+ "stream",
+]
+
def request(
method: str,
from hashlib import _Hash
+__all__ = ["Auth", "BasicAuth", "DigestAuth", "NetRCAuth"]
+
+
class Auth:
"""
Base class for all authentication schemes.
same_origin,
)
+__all__ = ["USE_CLIENT_DEFAULT", "AsyncClient", "Client"]
+
# The type annotation for @classmethod and context managers here follows PEP 484
# https://www.python.org/dev/peps/pep-0484/#annotating-instance-and-class-methods
T = typing.TypeVar("T", bound="Client")
from ._urls import URL
from ._utils import get_ca_bundle_from_env
+__all__ = ["Limits", "Proxy", "Timeout", "create_ssl_context"]
+
DEFAULT_CIPHERS = ":".join(
[
"ECDHE+AESGCM",
)
from ._utils import peek_filelike_length, primitive_value_to_str
+__all__ = ["ByteStream"]
+
class ByteStream(AsyncByteStream, SyncByteStream):
def __init__(self, stream: bytes) -> None:
if typing.TYPE_CHECKING:
from ._models import Request, Response # pragma: no cover
+__all__ = [
+ "CloseError",
+ "ConnectError",
+ "ConnectTimeout",
+ "CookieConflict",
+ "DecodingError",
+ "HTTPError",
+ "HTTPStatusError",
+ "InvalidURL",
+ "LocalProtocolError",
+ "NetworkError",
+ "PoolTimeout",
+ "ProtocolError",
+ "ProxyError",
+ "ReadError",
+ "ReadTimeout",
+ "RemoteProtocolError",
+ "RequestError",
+ "RequestNotRead",
+ "ResponseNotRead",
+ "StreamClosed",
+ "StreamConsumed",
+ "StreamError",
+ "TimeoutException",
+ "TooManyRedirects",
+ "TransportError",
+ "UnsupportedProtocol",
+ "WriteError",
+ "WriteTimeout",
+]
+
class HTTPError(Exception):
"""
parse_header_links,
)
+__all__ = ["Cookies", "Headers", "Request", "Response"]
+
class Headers(typing.MutableMapping[str, str]):
"""
from enum import IntEnum
+__all__ = ["codes"]
+
class codes(IntEnum):
"""HTTP status codes and reason phrases
+from .asgi import *
+from .base import *
+from .default import *
+from .mock import *
+from .wsgi import *
+
+__all__ = [
+ "ASGITransport",
+ "AsyncBaseTransport",
+ "BaseTransport",
+ "AsyncHTTPTransport",
+ "HTTPTransport",
+ "MockTransport",
+ "WSGITransport",
+]
[typing.Dict[str, typing.Any], _Receive, _Send], typing.Coroutine[None, None, None]
]
+__all__ = ["ASGITransport"]
+
def create_event() -> Event:
if sniffio.current_async_library() == "trio":
T = typing.TypeVar("T", bound="BaseTransport")
A = typing.TypeVar("A", bound="AsyncBaseTransport")
+__all__ = ["AsyncBaseTransport", "BaseTransport"]
+
class BaseTransport:
def __enter__(self: T) -> T:
typing.Tuple[int, int, None, int],
]
+__all__ = ["AsyncHTTPTransport", "HTTPTransport"]
+
@contextlib.contextmanager
def map_httpcore_exceptions() -> typing.Iterator[None]:
AsyncHandler = typing.Callable[[Request], typing.Coroutine[None, None, Response]]
+__all__ = ["MockTransport"]
+
+
class MockTransport(AsyncBaseTransport, BaseTransport):
def __init__(self, handler: SyncHandler | AsyncHandler) -> None:
self.handler = handler
_T = typing.TypeVar("_T")
+__all__ = ["WSGITransport"]
+
+
def _skip_leading_empty_chunks(body: typing.Iterable[_T]) -> typing.Iterable[_T]:
body = iter(body)
for chunk in body:
RequestExtensions = MutableMapping[str, Any]
+__all__ = ["AsyncByteStream", "SyncByteStream"]
+
class SyncByteStream:
def __iter__(self) -> Iterator[bytes]:
from ._urlparse import urlencode, urlparse
from ._utils import primitive_value_to_str
+__all__ = ["URL", "QueryParams"]
+
class URL:
"""
[tool.ruff.isort]
combine-as-imports = true
+[tool.ruff.lint.per-file-ignores]
+"__init__.py" = ["F403", "F405"]
+
[tool.mypy]
ignore_missing_imports = true
strict = true