__init__.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. from .__version__ import __description__, __title__, __version__
  2. from ._api import *
  3. from ._auth import *
  4. from ._client import *
  5. from ._config import *
  6. from ._content import *
  7. from ._exceptions import *
  8. from ._models import *
  9. from ._status_codes import *
  10. from ._transports import *
  11. from ._types import *
  12. from ._urls import *
  13. try:
  14. from ._main import main
  15. except ImportError: # pragma: no cover
  16. def main() -> None: # type: ignore
  17. import sys
  18. print(
  19. "The httpx command line client could not run because the required "
  20. "dependencies were not installed.\nMake sure you've installed "
  21. "everything with: pip install 'httpx[cli]'"
  22. )
  23. sys.exit(1)
  24. __all__ = [
  25. "__description__",
  26. "__title__",
  27. "__version__",
  28. "ASGITransport",
  29. "AsyncBaseTransport",
  30. "AsyncByteStream",
  31. "AsyncClient",
  32. "AsyncHTTPTransport",
  33. "Auth",
  34. "BaseTransport",
  35. "BasicAuth",
  36. "ByteStream",
  37. "Client",
  38. "CloseError",
  39. "codes",
  40. "ConnectError",
  41. "ConnectTimeout",
  42. "CookieConflict",
  43. "Cookies",
  44. "create_ssl_context",
  45. "DecodingError",
  46. "delete",
  47. "DigestAuth",
  48. "get",
  49. "head",
  50. "Headers",
  51. "HTTPError",
  52. "HTTPStatusError",
  53. "HTTPTransport",
  54. "InvalidURL",
  55. "Limits",
  56. "LocalProtocolError",
  57. "main",
  58. "MockTransport",
  59. "NetRCAuth",
  60. "NetworkError",
  61. "options",
  62. "patch",
  63. "PoolTimeout",
  64. "post",
  65. "ProtocolError",
  66. "Proxy",
  67. "ProxyError",
  68. "put",
  69. "QueryParams",
  70. "ReadError",
  71. "ReadTimeout",
  72. "RemoteProtocolError",
  73. "request",
  74. "Request",
  75. "RequestError",
  76. "RequestNotRead",
  77. "Response",
  78. "ResponseNotRead",
  79. "stream",
  80. "StreamClosed",
  81. "StreamConsumed",
  82. "StreamError",
  83. "SyncByteStream",
  84. "Timeout",
  85. "TimeoutException",
  86. "TooManyRedirects",
  87. "TransportError",
  88. "UnsupportedProtocol",
  89. "URL",
  90. "USE_CLIENT_DEFAULT",
  91. "WriteError",
  92. "WriteTimeout",
  93. "WSGITransport",
  94. ]
  95. __locals = locals()
  96. for __name in __all__:
  97. if not __name.startswith("__"):
  98. setattr(__locals[__name], "__module__", "httpx") # noqa