__init__.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. from redis import asyncio # noqa
  2. from redis.backoff import default_backoff
  3. from redis.client import Redis, StrictRedis
  4. from redis.cluster import RedisCluster
  5. from redis.connection import (
  6. BlockingConnectionPool,
  7. Connection,
  8. ConnectionPool,
  9. SSLConnection,
  10. UnixDomainSocketConnection,
  11. )
  12. from redis.credentials import CredentialProvider, UsernamePasswordCredentialProvider
  13. from redis.exceptions import (
  14. AuthenticationError,
  15. AuthenticationWrongNumberOfArgsError,
  16. BusyLoadingError,
  17. ChildDeadlockedError,
  18. ConnectionError,
  19. CrossSlotTransactionError,
  20. DataError,
  21. InvalidPipelineStack,
  22. InvalidResponse,
  23. OutOfMemoryError,
  24. PubSubError,
  25. ReadOnlyError,
  26. RedisClusterException,
  27. RedisError,
  28. ResponseError,
  29. TimeoutError,
  30. WatchError,
  31. )
  32. from redis.sentinel import (
  33. Sentinel,
  34. SentinelConnectionPool,
  35. SentinelManagedConnection,
  36. SentinelManagedSSLConnection,
  37. )
  38. from redis.utils import from_url
  39. def int_or_str(value):
  40. try:
  41. return int(value)
  42. except ValueError:
  43. return value
  44. # This version is used when building the package for publishing
  45. __version__ = "6.2.0"
  46. VERSION = tuple(map(int_or_str, __version__.split(".")))
  47. __all__ = [
  48. "AuthenticationError",
  49. "AuthenticationWrongNumberOfArgsError",
  50. "BlockingConnectionPool",
  51. "BusyLoadingError",
  52. "ChildDeadlockedError",
  53. "Connection",
  54. "ConnectionError",
  55. "ConnectionPool",
  56. "CredentialProvider",
  57. "CrossSlotTransactionError",
  58. "DataError",
  59. "from_url",
  60. "default_backoff",
  61. "InvalidPipelineStack",
  62. "InvalidResponse",
  63. "OutOfMemoryError",
  64. "PubSubError",
  65. "ReadOnlyError",
  66. "Redis",
  67. "RedisCluster",
  68. "RedisClusterException",
  69. "RedisError",
  70. "ResponseError",
  71. "Sentinel",
  72. "SentinelConnectionPool",
  73. "SentinelManagedConnection",
  74. "SentinelManagedSSLConnection",
  75. "SSLConnection",
  76. "UsernamePasswordCredentialProvider",
  77. "StrictRedis",
  78. "TimeoutError",
  79. "UnixDomainSocketConnection",
  80. "WatchError",
  81. ]