2 from datetime import datetime, timedelta
3 from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, Sequence, Text, Type, TypeVar, Union, overload
4 from typing_extensions import Literal
6 from .connection import ConnectionPool
11 def list_or_args(keys, args): ...
12 def timestamp_to_datetime(response): ...
13 def string_keys_to_dict(key_string, callback): ...
14 def dict_merge(*dicts): ...
15 def parse_debug_object(response): ...
16 def parse_object(response, infotype): ...
17 def parse_info(response): ...
19 SENTINEL_STATE_TYPES: Any
21 def parse_sentinel_state(item): ...
22 def parse_sentinel_master(response): ...
23 def parse_sentinel_masters(response): ...
24 def parse_sentinel_slaves_and_sentinels(response): ...
25 def parse_sentinel_get_master(response): ...
26 def pairs_to_dict(response): ...
27 def pairs_to_dict_typed(response, type_info): ...
28 def zset_score_pairs(response, **options): ...
29 def sort_return_tuples(response, **options): ...
30 def int_or_none(response): ...
31 def float_or_none(response): ...
32 def bool_ok(response): ...
33 def parse_client_list(response, **options): ...
34 def parse_config_get(response, **options): ...
35 def parse_scan(response, **options): ...
36 def parse_hscan(response, **options): ...
37 def parse_zscan(response, **options): ...
38 def parse_slowlog_get(response, **options): ...
40 _ScoreCastFuncReturn = TypeVar("_ScoreCastFuncReturn")
42 _Value = Union[bytes, float, int, Text]
43 _Key = Union[Text, bytes]
45 # Lib returns str or bytes depending on Python version and value of decode_responses
46 _StrType = TypeVar("_StrType", bound=Union[Text, bytes])
48 _LockType = TypeVar("_LockType")
50 class Redis(Generic[_StrType]):
51 RESPONSE_CALLBACKS: Any
60 password: Text | None,
61 socket_timeout: float | None,
62 socket_connect_timeout: float | None,
63 socket_keepalive: bool | None,
64 socket_keepalive_options: Mapping[str, int | str] | None,
65 connection_pool: ConnectionPool | None,
66 unix_socket_path: Text | None,
68 encoding_errors: Text,
71 decode_responses: Literal[True],
72 retry_on_timeout: bool = ...,
74 ssl_keyfile: Text | None = ...,
75 ssl_certfile: Text | None = ...,
76 ssl_cert_reqs: str | int | None = ...,
77 ssl_ca_certs: Text | None = ...,
78 ssl_check_hostname: bool = ...,
79 max_connections: int | None = ...,
80 single_connection_client: bool = ...,
81 health_check_interval: float = ...,
82 client_name: Text | None = ...,
83 username: Text | None = ...,
90 host: Text | None = ...,
91 port: int | None = ...,
93 password: Text | None = ...,
94 socket_timeout: float | None = ...,
95 socket_connect_timeout: float | None = ...,
96 socket_keepalive: bool | None = ...,
97 socket_keepalive_options: Mapping[str, int | str] | None = ...,
98 connection_pool: ConnectionPool | None = ...,
99 unix_socket_path: Text | None = ...,
100 encoding: Text = ...,
101 encoding_errors: Text = ...,
102 charset: Text | None = ...,
103 errors: Text | None = ...,
105 decode_responses: Literal[True],
106 retry_on_timeout: bool = ...,
108 ssl_keyfile: Text | None = ...,
109 ssl_certfile: Text | None = ...,
110 ssl_cert_reqs: str | int | None = ...,
111 ssl_ca_certs: Text | None = ...,
112 ssl_check_hostname: bool = ...,
113 max_connections: int | None = ...,
114 single_connection_client: bool = ...,
115 health_check_interval: float = ...,
116 client_name: Text | None = ...,
117 username: Text | None = ...,
124 host: Text | None = ...,
125 port: int | None = ...,
126 db: int | None = ...,
127 password: Text | None = ...,
128 socket_timeout: float | None = ...,
129 socket_connect_timeout: float | None = ...,
130 socket_keepalive: bool | None = ...,
131 socket_keepalive_options: Mapping[str, int | str] | None = ...,
132 connection_pool: ConnectionPool | None = ...,
133 unix_socket_path: Text | None = ...,
134 encoding: Text = ...,
135 encoding_errors: Text = ...,
136 charset: Text | None = ...,
137 decode_responses: Literal[False] = ...,
138 errors: Text | None = ...,
139 retry_on_timeout: bool = ...,
141 ssl_keyfile: Text | None = ...,
142 ssl_certfile: Text | None = ...,
143 ssl_cert_reqs: str | int | None = ...,
144 ssl_ca_certs: Text | None = ...,
145 ssl_check_hostname: bool = ...,
146 max_connections: int | None = ...,
147 single_connection_client: bool = ...,
148 health_check_interval: float = ...,
149 client_name: Text | None = ...,
150 username: Text | None = ...,
151 ) -> Redis[bytes]: ...
153 response_callbacks: Any
160 password: Text | None,
161 socket_timeout: float | None,
162 socket_connect_timeout: float | None,
163 socket_keepalive: bool | None,
164 socket_keepalive_options: Mapping[str, int | str] | None,
165 connection_pool: ConnectionPool | None,
166 unix_socket_path: Text | None,
168 encoding_errors: Text,
169 charset: Text | None,
170 decode_responses: Literal[True],
171 errors: Text | None = ...,
172 retry_on_timeout: bool = ...,
174 ssl_keyfile: Text | None = ...,
175 ssl_certfile: Text | None = ...,
176 ssl_cert_reqs: str | int | None = ...,
177 ssl_ca_certs: Text | None = ...,
178 ssl_check_hostname: bool = ...,
179 max_connections: int | None = ...,
180 single_connection_client: bool = ...,
181 health_check_interval: float = ...,
182 client_name: Text | None = ...,
183 username: Text | None = ...,
191 password: Text | None = ...,
192 socket_timeout: float | None = ...,
193 socket_connect_timeout: float | None = ...,
194 socket_keepalive: bool | None = ...,
195 socket_keepalive_options: Mapping[str, int | str] | None = ...,
196 connection_pool: ConnectionPool | None = ...,
197 unix_socket_path: Text | None = ...,
198 encoding: Text = ...,
199 encoding_errors: Text = ...,
200 charset: Text | None = ...,
202 decode_responses: Literal[True],
203 errors: Text | None = ...,
204 retry_on_timeout: bool = ...,
206 ssl_keyfile: Text | None = ...,
207 ssl_certfile: Text | None = ...,
208 ssl_cert_reqs: str | int | None = ...,
209 ssl_ca_certs: Text | None = ...,
210 ssl_check_hostname: bool = ...,
211 max_connections: int | None = ...,
212 single_connection_client: bool = ...,
213 health_check_interval: float = ...,
214 client_name: Text | None = ...,
215 username: Text | None = ...,
223 password: Text | None = ...,
224 socket_timeout: float | None = ...,
225 socket_connect_timeout: float | None = ...,
226 socket_keepalive: bool | None = ...,
227 socket_keepalive_options: Mapping[str, int | str] | None = ...,
228 connection_pool: ConnectionPool | None = ...,
229 unix_socket_path: Text | None = ...,
230 encoding: Text = ...,
231 encoding_errors: Text = ...,
232 charset: Text | None = ...,
233 errors: Text | None = ...,
234 decode_responses: Literal[False] = ...,
235 retry_on_timeout: bool = ...,
237 ssl_keyfile: Text | None = ...,
238 ssl_certfile: Text | None = ...,
239 ssl_cert_reqs: str | int | None = ...,
240 ssl_ca_certs: Text | None = ...,
241 ssl_check_hostname: bool = ...,
242 max_connections: int | None = ...,
243 single_connection_client: bool = ...,
244 health_check_interval: float = ...,
245 client_name: Text | None = ...,
246 username: Text | None = ...,
247 ) -> Redis[bytes]: ...
254 password: Text | None,
255 socket_timeout: float | None,
256 socket_connect_timeout: float | None,
257 socket_keepalive: bool | None,
258 socket_keepalive_options: Mapping[str, int | str] | None,
259 connection_pool: ConnectionPool | None,
260 unix_socket_path: Text | None,
262 encoding_errors: Text,
263 charset: Text | None,
265 decode_responses: Literal[True],
266 retry_on_timeout: bool = ...,
268 ssl_keyfile: Text | None = ...,
269 ssl_certfile: Text | None = ...,
270 ssl_cert_reqs: str | int | None = ...,
271 ssl_ca_certs: Text | None = ...,
272 ssl_check_hostname: bool = ...,
273 max_connections: int | None = ...,
274 single_connection_client: bool = ...,
275 health_check_interval: float = ...,
276 client_name: Text | None = ...,
277 username: Text | None = ...,
285 password: Text | None = ...,
286 socket_timeout: float | None = ...,
287 socket_connect_timeout: float | None = ...,
288 socket_keepalive: bool | None = ...,
289 socket_keepalive_options: Mapping[str, int | str] | None = ...,
290 connection_pool: ConnectionPool | None = ...,
291 unix_socket_path: Text | None = ...,
292 encoding: Text = ...,
293 encoding_errors: Text = ...,
294 charset: Text | None = ...,
295 errors: Text | None = ...,
297 decode_responses: Literal[True],
298 retry_on_timeout: bool = ...,
300 ssl_keyfile: Text | None = ...,
301 ssl_certfile: Text | None = ...,
302 ssl_cert_reqs: str | int | None = ...,
303 ssl_ca_certs: Text | None = ...,
304 ssl_check_hostname: bool = ...,
305 max_connections: int | None = ...,
306 single_connection_client: bool = ...,
307 health_check_interval: float = ...,
308 client_name: Text | None = ...,
309 username: Text | None = ...,
317 password: Text | None = ...,
318 socket_timeout: float | None = ...,
319 socket_connect_timeout: float | None = ...,
320 socket_keepalive: bool | None = ...,
321 socket_keepalive_options: Mapping[str, int | str] | None = ...,
322 connection_pool: ConnectionPool | None = ...,
323 unix_socket_path: Text | None = ...,
324 encoding: Text = ...,
325 encoding_errors: Text = ...,
326 charset: Text | None = ...,
327 errors: Text | None = ...,
328 decode_responses: Literal[False] = ...,
329 retry_on_timeout: bool = ...,
331 ssl_keyfile: Text | None = ...,
332 ssl_certfile: Text | None = ...,
333 ssl_cert_reqs: str | int | None = ...,
334 ssl_ca_certs: Text | None = ...,
335 ssl_check_hostname: bool = ...,
336 max_connections: int | None = ...,
337 single_connection_client: bool = ...,
338 health_check_interval: float = ...,
339 client_name: Text | None = ...,
340 username: Text | None = ...,
342 def set_response_callback(self, command, callback): ...
343 def pipeline(self, transaction: bool = ..., shard_hint: Any = ...) -> Pipeline[_StrType]: ...
344 def transaction(self, func, *watches, **kwargs): ...
349 timeout: float | None = ...,
351 blocking_timeout: float | None = ...,
352 lock_class: None = ...,
353 thread_local: bool = ...,
359 timeout: float | None,
361 blocking_timeout: float | None,
362 lock_class: Type[_LockType],
363 thread_local: bool = ...,
369 timeout: float | None = ...,
371 blocking_timeout: float | None = ...,
373 lock_class: Type[_LockType],
374 thread_local: bool = ...,
376 def pubsub(self, shard_hint: Any = ..., ignore_subscribe_messages: bool = ...) -> PubSub: ...
377 def execute_command(self, *args, **options): ...
378 def parse_response(self, connection, command_name, **options): ...
379 def acl_cat(self, category: Text | None = ...) -> list[str]: ...
380 def acl_deluser(self, username: Text) -> int: ...
381 def acl_genpass(self) -> Text: ...
382 def acl_getuser(self, username: Text) -> Any | None: ...
383 def acl_list(self) -> list[Text]: ...
384 def acl_load(self) -> bool: ...
387 username: Text = ...,
390 passwords: Sequence[Text] | None = ...,
391 hashed_passwords: Sequence[Text] | None = ...,
392 categories: Sequence[Text] | None = ...,
393 commands: Sequence[Text] | None = ...,
394 keys: Sequence[Text] | None = ...,
396 reset_keys: bool = ...,
397 reset_passwords: bool = ...,
399 def acl_users(self) -> list[Text]: ...
400 def acl_whoami(self) -> Text: ...
401 def bgrewriteaof(self): ...
402 def bgsave(self): ...
403 def client_id(self) -> int: ...
404 def client_kill(self, address: Text) -> bool: ...
405 def client_list(self) -> list[dict[str, str]]: ...
406 def client_getname(self) -> str | None: ...
407 def client_setname(self, name: Text) -> bool: ...
408 def readwrite(self) -> bool: ...
409 def readonly(self) -> bool: ...
410 def config_get(self, pattern=...): ...
411 def config_set(self, name, value): ...
412 def config_resetstat(self): ...
413 def config_rewrite(self): ...
414 def dbsize(self) -> int: ...
415 def debug_object(self, key): ...
416 def echo(self, value: _Value) -> bytes: ...
417 def flushall(self) -> bool: ...
418 def flushdb(self) -> bool: ...
419 def info(self, section: _Key | None = ...) -> Mapping[str, Any]: ...
420 def lastsave(self): ...
421 def object(self, infotype, key): ...
422 def ping(self) -> bool: ...
423 def save(self) -> bool: ...
424 def sentinel(self, *args): ...
425 def sentinel_get_master_addr_by_name(self, service_name): ...
426 def sentinel_master(self, service_name): ...
427 def sentinel_masters(self): ...
428 def sentinel_monitor(self, name, ip, port, quorum): ...
429 def sentinel_remove(self, name): ...
430 def sentinel_sentinels(self, service_name): ...
431 def sentinel_set(self, name, option, value): ...
432 def sentinel_slaves(self, service_name): ...
433 def shutdown(self): ...
434 def slaveof(self, host=..., port=...): ...
435 def slowlog_get(self, num=...): ...
436 def slowlog_len(self): ...
437 def slowlog_reset(self): ...
439 def append(self, key, value): ...
440 def bitcount(self, key: _Key, start: int | None = ..., end: int | None = ...) -> int: ...
441 def bitop(self, operation, dest, *keys): ...
442 def bitpos(self, key, bit, start=..., end=...): ...
443 def decr(self, name, amount=...) -> int: ...
444 def decrby(self, name, amount=...) -> int: ...
445 def delete(self, *names: _Key) -> int: ...
446 def __delitem__(self, _Key): ...
447 def dump(self, name): ...
448 def exists(self, *names: _Key) -> int: ...
450 def expire(self, name: _Key, time: int | timedelta) -> bool: ...
451 def expireat(self, name, when): ...
452 def get(self, name: _Key) -> _StrType | None: ...
453 def __getitem__(self, name): ...
454 def getbit(self, name: _Key, offset: int) -> int: ...
455 def getrange(self, key, start, end): ...
456 def getset(self, name, value) -> _StrType | None: ...
457 def incr(self, name: _Key, amount: int = ...) -> int: ...
458 def incrby(self, name: _Key, amount: int = ...) -> int: ...
459 def incrbyfloat(self, name: _Key, amount: float = ...) -> float: ...
460 def keys(self, pattern: _Key = ...) -> list[_StrType]: ...
461 def mget(self, keys: _Key | Iterable[_Key], *args: _Key) -> list[_StrType | None]: ...
462 def mset(self, mapping: Mapping[_Key, _Value]) -> Literal[True]: ...
463 def msetnx(self, mapping: Mapping[_Key, _Value]) -> bool: ...
464 def move(self, name: _Key, db: int) -> bool: ...
465 def persist(self, name: _Key) -> bool: ...
466 def pexpire(self, name: _Key, time: int | timedelta) -> Literal[1, 0]: ...
467 def pexpireat(self, name: _Key, when: int | datetime) -> Literal[1, 0]: ...
468 def psetex(self, name, time_ms, value): ...
469 def pttl(self, name): ...
470 def randomkey(self): ...
471 def rename(self, src, dst): ...
472 def renamenx(self, src, dst): ...
473 def restore(self, name, ttl, value, replace: bool = ...): ...
478 ex: None | int | timedelta = ...,
479 px: None | int | timedelta = ...,
483 ) -> bool | None: ...
484 def __setitem__(self, name, value): ...
485 def setbit(self, name: _Key, offset: int, value: int) -> int: ...
486 def setex(self, name: _Key, time: int | timedelta, value: _Value) -> bool: ...
487 def setnx(self, name: _Key, value: _Value) -> bool: ...
488 def setrange(self, name, offset, value): ...
489 def strlen(self, name): ...
490 def substr(self, name, start, end=...): ...
491 def ttl(self, name: _Key) -> int: ...
492 def type(self, name): ...
493 def watch(self, *names): ...
494 def unlink(self, *names: _Key) -> int: ...
495 def unwatch(self): ...
497 def blpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType]: ...
499 def blpop(self, keys: _Value | Iterable[_Value], timeout: float) -> tuple[_StrType, _StrType] | None: ...
501 def brpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType]: ...
503 def brpop(self, keys: _Value | Iterable[_Value], timeout: float) -> tuple[_StrType, _StrType] | None: ...
504 def brpoplpush(self, src, dst, timeout=...): ...
505 def lindex(self, name: _Key, index: int) -> _StrType | None: ...
507 self, name: _Key, where: Literal["BEFORE", "AFTER", "before", "after"], refvalue: _Value, value: _Value
509 def llen(self, name: _Key) -> int: ...
510 def lpop(self, name): ...
511 def lpush(self, name: _Value, *values: _Value) -> int: ...
512 def lpushx(self, name, value): ...
513 def lrange(self, name: _Key, start: int, end: int) -> list[_StrType]: ...
514 def lrem(self, name: _Key, count: int, value: _Value) -> int: ...
515 def lset(self, name: _Key, index: int, value: _Value) -> bool: ...
516 def ltrim(self, name: _Key, start: int, end: int) -> bool: ...
517 def rpop(self, name): ...
518 def rpoplpush(self, src, dst): ...
519 def rpush(self, name: _Value, *values: _Value) -> int: ...
520 def rpushx(self, name, value): ...
525 start: int | None = ...,
526 num: int | None = ...,
527 by: _Key | None = ...,
528 get: _Key | Sequence[_Key] | None = ...,
533 ) -> list[_StrType]: ...
538 start: int | None = ...,
539 num: int | None = ...,
540 by: _Key | None = ...,
541 get: _Key | Sequence[_Key] | None = ...,
555 get: _Key | Sequence[_Key] | None,
561 def scan(self, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> tuple[int, list[_StrType]]: ...
562 def scan_iter(self, match: Text | None = ..., count: int | None = ...) -> Iterator[_StrType]: ...
563 def sscan(self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...) -> tuple[int, list[_StrType]]: ...
564 def sscan_iter(self, name, match=..., count=...): ...
566 self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...
567 ) -> tuple[int, dict[_StrType, _StrType]]: ...
568 def hscan_iter(self, name, match=..., count=...): ...
569 def zscan(self, name, cursor=..., match=..., count=..., score_cast_func=...): ...
570 def zscan_iter(self, name, match=..., count=..., score_cast_func=...): ...
571 def sadd(self, name: _Key, *values: _Value) -> int: ...
572 def scard(self, name: _Key) -> int: ...
573 def sdiff(self, keys: _Key | Iterable[_Key], *args: _Key) -> builtins.set[_Value]: ...
574 def sdiffstore(self, dest: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> int: ...
575 def sinter(self, keys: _Key | Iterable[_Key], *args: _Key) -> builtins.set[_Value]: ...
576 def sinterstore(self, dest: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> int: ...
577 def sismember(self, name: _Key, value: _Value) -> bool: ...
578 def smembers(self, name: _Key) -> builtins.set[_StrType]: ...
579 def smove(self, src: _Key, dst: _Key, value: _Value) -> bool: ...
581 def spop(self, name: _Key, count: None = ...) -> _Value | None: ...
583 def spop(self, name: _Key, count: int) -> list[_Value]: ...
585 def srandmember(self, name: _Key, number: None = ...) -> _Value | None: ...
587 def srandmember(self, name: _Key, number: int) -> list[_Value]: ...
588 def srem(self, name: _Key, *values: _Value) -> int: ...
589 def sunion(self, keys: _Key | Iterable[_Key], *args: _Key) -> builtins.set[_Value]: ...
590 def sunionstore(self, dest: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> int: ...
591 def xack(self, name, groupname, *ids): ...
592 def xadd(self, name, fields, id=..., maxlen=..., approximate=...): ...
594 self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=...
596 def xdel(self, name, *ids): ...
597 def xgroup_create(self, name, groupname, id=..., mkstream=...): ...
598 def xgroup_delconsumer(self, name, groupname, consumername): ...
599 def xgroup_destroy(self, name, groupname): ...
600 def xgroup_setid(self, name, groupname, id): ...
601 def xinfo_consumers(self, name, groupname): ...
602 def xinfo_groups(self, name): ...
603 def xinfo_stream(self, name): ...
604 def xlen(self, name: _Key) -> int: ...
605 def xpending(self, name, groupname): ...
606 def xpending_range(self, name, groupname, min, max, count, consumername=...): ...
607 def xrange(self, name, min=..., max=..., count=...): ...
608 def xread(self, streams, count=..., block=...): ...
609 def xreadgroup(self, groupname, consumername, streams, count=..., block=..., noack=...): ...
610 def xrevrange(self, name, max=..., min=..., count=...): ...
611 def xtrim(self, name, maxlen, approximate=...): ...
613 self, name: _Key, mapping: Mapping[_Key, _Value], nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ...
615 def zcard(self, name: _Key) -> int: ...
616 def zcount(self, name: _Key, min: _Value, max: _Value) -> int: ...
617 def zincrby(self, name: _Key, amount: float, value: _Value) -> float: ...
618 def zinterstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] = ...) -> int: ...
619 def zlexcount(self, name: _Key, min: _Value, max: _Value) -> int: ...
620 def zpopmax(self, name: _Key, count: int | None = ...) -> list[_StrType]: ...
621 def zpopmin(self, name: _Key, count: int | None = ...) -> list[_StrType]: ...
623 def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType, float]: ...
625 def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ...
627 def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType, float]: ...
629 def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ...
638 withscores: Literal[True],
639 score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
640 ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
648 withscores: bool = ...,
649 score_cast_func: Callable[[Any], Any] = ...,
650 ) -> list[_StrType]: ...
652 self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ...
653 ) -> list[_StrType]: ...
660 start: int | None = ...,
661 num: int | None = ...,
663 withscores: Literal[True],
664 score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
665 ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
672 start: int | None = ...,
673 num: int | None = ...,
674 withscores: bool = ...,
675 score_cast_func: Callable[[Any], Any] = ...,
676 ) -> list[_StrType]: ...
677 def zrank(self, name: _Key, value: _Value) -> int | None: ...
678 def zrem(self, name: _Key, *values: _Value) -> int: ...
679 def zremrangebylex(self, name: _Key, min: _Value, max: _Value) -> int: ...
680 def zremrangebyrank(self, name: _Key, min: int, max: int) -> int: ...
681 def zremrangebyscore(self, name: _Key, min: _Value, max: _Value) -> int: ...
690 withscores: Literal[True],
691 score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
692 ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
700 withscores: bool = ...,
701 score_cast_func: Callable[[Any], Any] = ...,
702 ) -> list[_StrType]: ...
704 def zrevrangebyscore(
709 start: int | None = ...,
710 num: int | None = ...,
712 withscores: Literal[True],
713 score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
714 ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
716 def zrevrangebyscore(
721 start: int | None = ...,
722 num: int | None = ...,
723 withscores: bool = ...,
724 score_cast_func: Callable[[Any], Any] = ...,
725 ) -> list[_StrType]: ...
727 self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ...
728 ) -> list[_StrType]: ...
729 def zrevrank(self, name: _Key, value: _Value) -> int | None: ...
730 def zscore(self, name: _Key, value: _Value) -> float | None: ...
731 def zunionstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] = ...) -> int: ...
732 def pfadd(self, name: _Key, *values: _Value) -> int: ...
733 def pfcount(self, name: _Key) -> int: ...
734 def pfmerge(self, dest: _Key, *sources: _Key) -> bool: ...
735 def hdel(self, name: _Key, *keys: _Key) -> int: ...
736 def hexists(self, name: _Key, key: _Key) -> bool: ...
737 def hget(self, name: _Key, key: _Key) -> _StrType | None: ...
738 def hgetall(self, name: _Key) -> dict[_StrType, _StrType]: ...
739 def hincrby(self, name: _Key, key: _Key, amount: int = ...) -> int: ...
740 def hincrbyfloat(self, name: _Key, key: _Key, amount: float = ...) -> float: ...
741 def hkeys(self, name: _Key) -> list[_StrType]: ...
742 def hlen(self, name: _Key) -> int: ...
744 def hset(self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ...) -> int: ...
746 def hset(self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value]) -> int: ...
748 def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value]) -> int: ...
749 def hsetnx(self, name: _Key, key: _Key, value: _Value) -> int: ...
750 def hmset(self, name: _Key, mapping: Mapping[_Key, _Value]) -> bool: ...
751 def hmget(self, name: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> list[_StrType | None]: ...
752 def hvals(self, name: _Key) -> list[_StrType]: ...
753 def publish(self, channel: _Key, message: _Key) -> int: ...
754 def eval(self, script, numkeys, *keys_and_args): ...
755 def evalsha(self, sha, numkeys, *keys_and_args): ...
756 def script_exists(self, *args): ...
757 def script_flush(self): ...
758 def script_kill(self): ...
759 def script_load(self, script): ...
760 def register_script(self, script: Text | _StrType) -> Script: ...
761 def pubsub_channels(self, pattern: _Key = ...) -> list[Text]: ...
762 def pubsub_numsub(self, *args: _Key) -> list[tuple[Text, int]]: ...
763 def pubsub_numpat(self) -> int: ...
764 def monitor(self) -> Monitor: ...
765 def memory_stats(self) -> dict[str, Any]: ...
766 def memory_purge(self) -> bool: ...
767 def cluster(self, cluster_arg: str, *args: Any) -> Any: ...
768 def __enter__(self) -> Redis[_StrType]: ...
769 def __exit__(self, exc_type, exc_value, traceback): ...
770 def __del__(self) -> None: ...
771 def close(self) -> None: ...
772 def client(self) -> Redis[_StrType]: ...
777 PUBLISH_MESSAGE_TYPES: Any
778 UNSUBSCRIBE_MESSAGE_TYPES: Any
781 ignore_subscribe_messages: Any
785 decode_responses: Any
786 def __init__(self, connection_pool, shard_hint=..., ignore_subscribe_messages=...) -> None: ...
787 def __del__(self): ...
791 def close(self) -> None: ...
792 def on_connect(self, connection): ...
793 def encode(self, value): ...
795 def subscribed(self): ...
796 def execute_command(self, *args, **kwargs): ...
797 def parse_response(self, block=...): ...
798 def psubscribe(self, *args: _Key, **kwargs: Callable[[Any], None]): ...
799 def punsubscribe(self, *args: _Key) -> None: ...
800 def subscribe(self, *args: _Key, **kwargs: Callable[[Any], None]) -> None: ...
801 def unsubscribe(self, *args: _Key) -> None: ...
802 def listen(self): ...
803 def get_message(self, ignore_subscribe_messages: bool = ..., timeout: float = ...) -> dict[str, Any] | None: ...
804 def handle_message(self, response, ignore_subscribe_messages: bool = ...) -> dict[str, Any] | None: ...
805 def run_in_thread(self, sleep_time=...): ...
806 def ping(self, message: _Value | None = ...) -> None: ...
808 class Pipeline(Redis[_StrType], Generic[_StrType]):
809 UNWATCH_COMMANDS: Any
812 response_callbacks: Any
819 explicit_transaction: Any
820 def __init__(self, connection_pool, response_callbacks, transaction, shard_hint) -> None: ...
821 def __enter__(self) -> Pipeline[_StrType]: ... # type: ignore[override]
822 def __exit__(self, exc_type, exc_value, traceback) -> None: ...
823 def __del__(self) -> None: ...
824 def __len__(self) -> int: ...
825 def __bool__(self) -> bool: ...
826 def reset(self) -> None: ...
827 def multi(self) -> None: ...
828 def execute_command(self, *args, **options): ...
829 def immediate_execute_command(self, *args, **options): ...
830 def pipeline_execute_command(self, *args, **options): ...
831 def raise_first_error(self, commands, response): ...
832 def annotate_exception(self, exception, number, command): ...
833 def parse_response(self, connection, command_name, **options): ...
834 def load_scripts(self): ...
835 def execute(self, raise_on_error: bool = ...) -> list[Any]: ...
836 def watch(self, *names: _Key) -> bool: ...
837 def unwatch(self) -> bool: ...
838 # in the Redis implementation, the following methods are inherited from client.
839 def set_response_callback(self, command, callback): ...
840 def pipeline(self, transaction: bool = ..., shard_hint: Any = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
841 def lock(self, name, timeout=..., sleep=..., blocking_timeout=..., lock_class=..., thread_local=...): ...
842 def pubsub(self, shard_hint: Any = ..., ignore_subscribe_messages: bool = ...) -> PubSub: ...
843 def acl_cat(self, category: Text | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
844 def acl_deluser(self, username: Text) -> Pipeline[_StrType]: ... # type: ignore[override]
845 def acl_genpass(self) -> Pipeline[_StrType]: ... # type: ignore[override]
846 def acl_getuser(self, username: Text) -> Pipeline[_StrType]: ... # type: ignore[override]
847 def acl_list(self) -> Pipeline[_StrType]: ... # type: ignore[override]
848 def acl_load(self) -> Pipeline[_StrType]: ... # type: ignore[override]
849 def acl_setuser( # type: ignore[override]
851 username: Text = ...,
854 passwords: Sequence[Text] | None = ...,
855 hashed_passwords: Sequence[Text] | None = ...,
856 categories: Sequence[Text] | None = ...,
857 commands: Sequence[Text] | None = ...,
858 keys: Sequence[Text] | None = ...,
860 reset_keys: bool = ...,
861 reset_passwords: bool = ...,
862 ) -> Pipeline[_StrType]: ...
863 def acl_users(self) -> Pipeline[_StrType]: ... # type: ignore[override]
864 def acl_whoami(self) -> Pipeline[_StrType]: ... # type: ignore[override]
865 def bgrewriteaof(self) -> Pipeline[_StrType]: ... # type: ignore[override]
866 def bgsave(self) -> Pipeline[_StrType]: ... # type: ignore[override]
867 def client_id(self) -> Pipeline[_StrType]: ... # type: ignore[override]
868 def client_kill(self, address: Text) -> Pipeline[_StrType]: ... # type: ignore[override]
869 def client_list(self) -> Pipeline[_StrType]: ... # type: ignore[override]
870 def client_getname(self) -> Pipeline[_StrType]: ... # type: ignore[override]
871 def client_setname(self, name: Text) -> Pipeline[_StrType]: ... # type: ignore[override]
872 def readwrite(self) -> Pipeline[_StrType]: ... # type: ignore[override]
873 def readonly(self) -> Pipeline[_StrType]: ... # type: ignore[override]
874 def config_get(self, pattern=...) -> Pipeline[_StrType]: ... # type: ignore[override]
875 def config_set(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
876 def config_resetstat(self) -> Pipeline[_StrType]: ... # type: ignore[override]
877 def config_rewrite(self) -> Pipeline[_StrType]: ... # type: ignore[override]
878 def dbsize(self) -> Pipeline[_StrType]: ... # type: ignore[override]
879 def debug_object(self, key) -> Pipeline[_StrType]: ... # type: ignore[override]
880 def echo(self, value) -> Pipeline[_StrType]: ... # type: ignore[override]
881 def flushall(self) -> Pipeline[_StrType]: ... # type: ignore[override]
882 def flushdb(self) -> Pipeline[_StrType]: ... # type: ignore[override]
883 def info(self, section: _Key | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
884 def lastsave(self) -> Pipeline[_StrType]: ... # type: ignore[override]
885 def object(self, infotype, key) -> Pipeline[_StrType]: ... # type: ignore[override]
886 def ping(self) -> Pipeline[_StrType]: ... # type: ignore[override]
887 def save(self) -> Pipeline[_StrType]: ... # type: ignore[override]
888 def sentinel(self, *args) -> None: ...
889 def sentinel_get_master_addr_by_name(self, service_name) -> Pipeline[_StrType]: ... # type: ignore[override]
890 def sentinel_master(self, service_name) -> Pipeline[_StrType]: ... # type: ignore[override]
891 def sentinel_masters(self) -> Pipeline[_StrType]: ... # type: ignore[override]
892 def sentinel_monitor(self, name, ip, port, quorum) -> Pipeline[_StrType]: ... # type: ignore[override]
893 def sentinel_remove(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
894 def sentinel_sentinels(self, service_name) -> Pipeline[_StrType]: ... # type: ignore[override]
895 def sentinel_set(self, name, option, value) -> Pipeline[_StrType]: ... # type: ignore[override]
896 def sentinel_slaves(self, service_name) -> Pipeline[_StrType]: ... # type: ignore[override]
897 def shutdown(self) -> None: ...
898 def slaveof(self, host=..., port=...) -> Pipeline[_StrType]: ... # type: ignore[override]
899 def slowlog_get(self, num=...) -> Pipeline[_StrType]: ... # type: ignore[override]
900 def slowlog_len(self) -> Pipeline[_StrType]: ... # type: ignore[override]
901 def slowlog_reset(self) -> Pipeline[_StrType]: ... # type: ignore[override]
902 def time(self) -> Pipeline[_StrType]: ... # type: ignore[override]
903 def append(self, key, value) -> Pipeline[_StrType]: ... # type: ignore[override]
904 def bitcount(self, key: _Key, start: int | None = ..., end: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
905 def bitop(self, operation, dest, *keys) -> Pipeline[_StrType]: ... # type: ignore[override]
906 def bitpos(self, key, bit, start=..., end=...) -> Pipeline[_StrType]: ... # type: ignore[override]
907 def decr(self, name, amount=...) -> Pipeline[_StrType]: ... # type: ignore[override]
908 def delete(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
909 def __delitem__(self, _Key) -> None: ...
910 def dump(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
911 def exists(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
912 def __contains__(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
913 def expire(self, name: _Key, time: int | timedelta) -> Pipeline[_StrType]: ... # type: ignore[override]
914 def expireat(self, name, when) -> Pipeline[_StrType]: ... # type: ignore[override]
915 def get(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
916 def __getitem__(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
917 def getbit(self, name: _Key, offset: int) -> Pipeline[_StrType]: ... # type: ignore[override]
918 def getrange(self, key, start, end) -> Pipeline[_StrType]: ... # type: ignore[override]
919 def getset(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
920 def incr(self, name, amount=...) -> Pipeline[_StrType]: ... # type: ignore[override]
921 def incrby(self, name, amount=...) -> Pipeline[_StrType]: ... # type: ignore[override]
922 def incrbyfloat(self, name, amount=...) -> Pipeline[_StrType]: ... # type: ignore[override]
923 def keys(self, pattern: _Key = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
924 def mget(self, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
925 def mset(self, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ... # type: ignore[override]
926 def msetnx(self, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ... # type: ignore[override]
927 def move(self, name: _Key, db: int) -> Pipeline[_StrType]: ... # type: ignore[override]
928 def persist(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
929 def pexpire(self, name: _Key, time: int | timedelta) -> Pipeline[_StrType]: ... # type: ignore[override]
930 def pexpireat(self, name: _Key, when: int | datetime) -> Pipeline[_StrType]: ... # type: ignore[override]
931 def psetex(self, name, time_ms, value) -> Pipeline[_StrType]: ... # type: ignore[override]
932 def pttl(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
933 def randomkey(self) -> Pipeline[_StrType]: ... # type: ignore[override]
934 def rename(self, src, dst) -> Pipeline[_StrType]: ... # type: ignore[override]
935 def renamenx(self, src, dst) -> Pipeline[_StrType]: ... # type: ignore[override]
936 def restore(self, name, ttl, value, replace: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
937 def set( # type: ignore[override]
941 ex: None | int | timedelta = ...,
942 px: None | int | timedelta = ...,
946 ) -> Pipeline[_StrType]: ...
947 def __setitem__(self, name, value) -> None: ...
948 def setbit(self, name: _Key, offset: int, value: int) -> Pipeline[_StrType]: ... # type: ignore[override]
949 def setex(self, name: _Key, time: int | timedelta, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
950 def setnx(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
951 def setrange(self, name, offset, value) -> Pipeline[_StrType]: ... # type: ignore[override]
952 def strlen(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
953 def substr(self, name, start, end=...) -> Pipeline[_StrType]: ... # type: ignore[override]
954 def ttl(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
955 def type(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
956 def unlink(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
957 def blpop(self, keys: _Value | Iterable[_Value], timeout: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
958 def brpop(self, keys: _Value | Iterable[_Value], timeout: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
959 def brpoplpush(self, src, dst, timeout=...) -> Pipeline[_StrType]: ... # type: ignore[override]
960 def lindex(self, name: _Key, index: int) -> Pipeline[_StrType]: ... # type: ignore[override]
961 def linsert( # type: ignore[override]
962 self, name: _Key, where: Literal["BEFORE", "AFTER", "before", "after"], refvalue: _Value, value: _Value
963 ) -> Pipeline[_StrType]: ...
964 def llen(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
965 def lpop(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
966 def lpush(self, name: _Value, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
967 def lpushx(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
968 def lrange(self, name: _Key, start: int, end: int) -> Pipeline[_StrType]: ... # type: ignore[override]
969 def lrem(self, name: _Key, count: int, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
970 def lset(self, name: _Key, index: int, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
971 def ltrim(self, name: _Key, start: int, end: int) -> Pipeline[_StrType]: ... # type: ignore[override]
972 def rpop(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
973 def rpoplpush(self, src, dst) -> Pipeline[_StrType]: ... # type: ignore[override]
974 def rpush(self, name: _Value, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
975 def rpushx(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
976 def sort( # type: ignore[override]
979 start: int | None = ...,
980 num: int | None = ...,
981 by: _Key | None = ...,
982 get: _Key | Sequence[_Key] | None = ...,
985 store: _Key | None = ...,
987 ) -> Pipeline[_StrType]: ...
988 def scan(self, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
989 def scan_iter(self, match: Text | None = ..., count: int | None = ...) -> Iterator[Any]: ...
990 def sscan(self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
991 def sscan_iter(self, name, match=..., count=...) -> Iterator[Any]: ...
992 def hscan(self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
993 def hscan_iter(self, name, match=..., count=...) -> Iterator[Any]: ...
994 def zscan(self, name, cursor=..., match=..., count=..., score_cast_func=...) -> Pipeline[_StrType]: ... # type: ignore[override]
995 def zscan_iter(self, name, match=..., count=..., score_cast_func=...) -> Iterator[Any]: ...
996 def sadd(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
997 def scard(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
998 def sdiff(self, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
999 def sdiffstore(self, dest: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1000 def sinter(self, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1001 def sinterstore(self, dest: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1002 def sismember(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1003 def smembers(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1004 def smove(self, src: _Key, dst: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1005 def spop(self, name: _Key, count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1006 def srandmember(self, name: _Key, number: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1007 def srem(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1008 def sunion(self, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1009 def sunionstore(self, dest: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1010 def xack(self, name, groupname, *ids) -> Pipeline[_StrType]: ... # type: ignore[override]
1011 def xadd(self, name, fields, id=..., maxlen=..., approximate=...) -> Pipeline[_StrType]: ... # type: ignore[override]
1013 self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=...
1014 ) -> Pipeline[_StrType]: ... # type: ignore[override]
1015 def xdel(self, name, *ids) -> Pipeline[_StrType]: ... # type: ignore[override]
1016 def xgroup_create(self, name, groupname, id=..., mkstream=...) -> Pipeline[_StrType]: ... # type: ignore[override]
1017 def xgroup_delconsumer(self, name, groupname, consumername) -> Pipeline[_StrType]: ... # type: ignore[override]
1018 def xgroup_destroy(self, name, groupname) -> Pipeline[_StrType]: ... # type: ignore[override]
1019 def xgroup_setid(self, name, groupname, id) -> Pipeline[_StrType]: ... # type: ignore[override]
1020 def xinfo_consumers(self, name, groupname) -> Pipeline[_StrType]: ... # type: ignore[override]
1021 def xinfo_groups(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
1022 def xinfo_stream(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
1023 def xlen(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1024 def xpending(self, name, groupname) -> Pipeline[_StrType]: ... # type: ignore[override]
1025 def xpending_range(self, name, groupname, min, max, count, consumername=...) -> Pipeline[_StrType]: ... # type: ignore[override]
1026 def xrange(self, name, min=..., max=..., count=...) -> Pipeline[_StrType]: ... # type: ignore[override]
1027 def xread(self, streams, count=..., block=...) -> Pipeline[_StrType]: ... # type: ignore[override]
1028 def xreadgroup(self, groupname, consumername, streams, count=..., block=..., noack=...) -> Pipeline[_StrType]: ... # type: ignore[override]
1029 def xrevrange(self, name, max=..., min=..., count=...) -> Pipeline[_StrType]: ... # type: ignore[override]
1030 def xtrim(self, name, maxlen, approximate=...) -> Pipeline[_StrType]: ... # type: ignore[override]
1031 def zadd( # type: ignore[override]
1032 self, name: _Key, mapping: Mapping[_Key, _Value], nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ...
1033 ) -> Pipeline[_StrType]: ...
1034 def zcard(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1035 def zcount(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1036 def zincrby(self, name: _Key, amount: float, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1037 def zinterstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1038 def zlexcount(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1039 def zpopmax(self, name: _Key, count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1040 def zpopmin(self, name: _Key, count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1041 def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1042 def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1043 def zrange( # type: ignore[override]
1049 withscores: bool = ...,
1050 score_cast_func: Callable[[Any], Any] = ...,
1051 ) -> Pipeline[_StrType]: ...
1052 def zrangebylex(self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1053 def zrangebyscore( # type: ignore[override]
1058 start: int | None = ...,
1059 num: int | None = ...,
1060 withscores: bool = ...,
1061 score_cast_func: Callable[[Any], Any] = ...,
1062 ) -> Pipeline[_StrType]: ...
1063 def zrank(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1064 def zrem(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1065 def zremrangebylex(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1066 def zremrangebyrank(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1067 def zremrangebyscore(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1068 def zrevrange( # type: ignore[override]
1074 withscores: bool = ...,
1075 score_cast_func: Callable[[Any], Any] = ...,
1076 ) -> Pipeline[_StrType]: ...
1077 def zrevrangebyscore( # type: ignore[override]
1082 start: int | None = ...,
1083 num: int | None = ...,
1084 withscores: bool = ...,
1085 score_cast_func: Callable[[Any], Any] = ...,
1086 ) -> Pipeline[_StrType]: ...
1087 def zrevrangebylex( # type: ignore[override]
1088 self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ...
1089 ) -> Pipeline[_StrType]: ...
1090 def zrevrank(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1091 def zscore(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1092 def zunionstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1093 def pfadd(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1094 def pfcount(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1095 def pfmerge(self, dest: _Key, *sources: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1096 def hdel(self, name: _Key, *keys: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1097 def hexists(self, name: _Key, key: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1098 def hget(self, name: _Key, key: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1099 def hgetall(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1100 def hincrby(self, name: _Key, key: _Key, amount: int = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1101 def hincrbyfloat(self, name: _Key, key: _Key, amount: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1102 def hkeys(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1103 def hlen(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1104 @overload # type: ignore[override]
1105 def hset(self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ...) -> Pipeline[_StrType]: ...
1106 @overload # type: ignore[override]
1107 def hset(self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ...
1108 @overload # type: ignore[override]
1109 def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ...
1110 def hsetnx(self, name: _Key, key: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
1111 def hmset(self, name: _Key, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ... # type: ignore[override]
1112 def hmget(self, name: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1113 def hvals(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1114 def publish(self, channel: _Key, message: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1115 def eval(self, script, numkeys, *keys_and_args) -> Pipeline[_StrType]: ... # type: ignore[override]
1116 def evalsha(self, sha, numkeys, *keys_and_args) -> Pipeline[_StrType]: ... # type: ignore[override]
1117 def script_exists(self, *args) -> Pipeline[_StrType]: ... # type: ignore[override]
1118 def script_flush(self) -> Pipeline[_StrType]: ... # type: ignore[override]
1119 def script_kill(self) -> Pipeline[_StrType]: ... # type: ignore[override]
1120 def script_load(self, script) -> Pipeline[_StrType]: ... # type: ignore[override]
1121 def register_script(self, script: Text | _StrType) -> Script: ...
1122 def pubsub_channels(self, pattern: _Key = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
1123 def pubsub_numsub(self, *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
1124 def pubsub_numpat(self) -> Pipeline[_StrType]: ... # type: ignore[override]
1125 def monitor(self) -> Monitor: ...
1126 def cluster(self, cluster_arg: str, *args: Any) -> Pipeline[_StrType]: ... # type: ignore[override]
1127 def client(self) -> Any: ...
1130 registered_client: Any
1133 def __init__(self, registered_client, script) -> None: ...
1134 def __call__(self, keys=..., args=..., client=...): ...
1136 class Monitor(object):
1137 def __init__(self, connection_pool) -> None: ...
1138 def __enter__(self) -> Monitor: ...
1139 def __exit__(self, *args: Any) -> None: ...
1140 def next_command(self) -> dict[Text, Any]: ...
1141 def listen(self) -> Iterable[dict[Text, Any]]: ...