redis 5.2.1__tar.gz → 6.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- redis-6.4.0/.gitignore +29 -0
- {redis-5.2.1 → redis-6.4.0}/PKG-INFO +67 -23
- redis-5.2.1/redis.egg-info/PKG-INFO → redis-6.4.0/README.md +49 -45
- redis-6.4.0/dev_requirements.txt +16 -0
- redis-6.4.0/pyproject.toml +123 -0
- {redis-5.2.1 → redis-6.4.0}/redis/__init__.py +10 -11
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/__init__.py +8 -1
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/base.py +67 -3
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/helpers.py +2 -1
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/hiredis.py +72 -5
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/resp3.py +12 -37
- {redis-5.2.1 → redis-6.4.0}/redis/asyncio/client.py +146 -86
- {redis-5.2.1 → redis-6.4.0}/redis/asyncio/cluster.py +933 -163
- {redis-5.2.1 → redis-6.4.0}/redis/asyncio/connection.py +159 -43
- {redis-5.2.1 → redis-6.4.0}/redis/asyncio/lock.py +26 -5
- {redis-5.2.1 → redis-6.4.0}/redis/asyncio/retry.py +14 -23
- {redis-5.2.1 → redis-6.4.0}/redis/asyncio/sentinel.py +44 -19
- {redis-5.2.1 → redis-6.4.0}/redis/asyncio/utils.py +1 -1
- redis-6.4.0/redis/auth/err.py +31 -0
- redis-6.4.0/redis/auth/idp.py +28 -0
- redis-6.4.0/redis/auth/token.py +130 -0
- redis-6.4.0/redis/auth/token_manager.py +370 -0
- {redis-5.2.1 → redis-6.4.0}/redis/backoff.py +69 -0
- {redis-5.2.1 → redis-6.4.0}/redis/client.py +226 -147
- {redis-5.2.1 → redis-6.4.0}/redis/cluster.py +1239 -406
- {redis-5.2.1 → redis-6.4.0}/redis/commands/cluster.py +1 -11
- {redis-5.2.1 → redis-6.4.0}/redis/commands/core.py +396 -322
- {redis-5.2.1 → redis-6.4.0}/redis/commands/helpers.py +19 -76
- {redis-5.2.1 → redis-6.4.0}/redis/commands/json/__init__.py +1 -1
- redis-6.4.0/redis/commands/json/_util.py +5 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/json/commands.py +8 -8
- {redis-5.2.1 → redis-6.4.0}/redis/commands/redismodules.py +24 -26
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/aggregation.py +6 -4
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/commands.py +46 -19
- redis-6.4.0/redis/commands/search/dialect.py +3 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/field.py +4 -4
- redis-6.4.0/redis/commands/search/profile_information.py +14 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/query.py +5 -1
- {redis-5.2.1 → redis-6.4.0}/redis/commands/sentinel.py +42 -12
- {redis-5.2.1 → redis-6.4.0}/redis/commands/timeseries/__init__.py +1 -1
- redis-6.4.0/redis/commands/vectorset/__init__.py +46 -0
- redis-6.4.0/redis/commands/vectorset/commands.py +374 -0
- redis-6.4.0/redis/commands/vectorset/utils.py +94 -0
- {redis-5.2.1 → redis-6.4.0}/redis/connection.py +187 -45
- redis-6.4.0/redis/credentials.py +65 -0
- redis-6.4.0/redis/event.py +394 -0
- {redis-5.2.1 → redis-6.4.0}/redis/exceptions.py +29 -2
- {redis-5.2.1 → redis-6.4.0}/redis/lock.py +24 -4
- {redis-5.2.1 → redis-6.4.0}/redis/ocsp.py +2 -1
- {redis-5.2.1 → redis-6.4.0}/redis/retry.py +53 -10
- {redis-5.2.1 → redis-6.4.0}/redis/sentinel.py +33 -16
- {redis-5.2.1 → redis-6.4.0}/redis/typing.py +1 -5
- {redis-5.2.1 → redis-6.4.0}/redis/utils.py +123 -3
- {redis-5.2.1 → redis-6.4.0}/tests/conftest.py +70 -9
- redis-6.4.0/tests/entraid_utils.py +173 -0
- redis-6.4.0/tests/test_asyncio/__init__.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/compat.py +0 -6
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/conftest.py +11 -4
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_bloom.py +28 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_cluster.py +261 -65
- redis-6.4.0/tests/test_asyncio/test_cluster_transaction.py +399 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_commands.py +465 -16
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_connect.py +12 -1
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_connection.py +16 -18
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_connection_pool.py +49 -40
- redis-6.4.0/tests/test_asyncio/test_credentials.py +712 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_encoding.py +1 -1
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_hash.py +276 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_lock.py +35 -4
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_pipeline.py +19 -1
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_pubsub.py +8 -6
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_retry.py +2 -2
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_scripting.py +8 -8
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_search.py +314 -21
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_sentinel.py +86 -7
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_sentinel_managed_connection.py +2 -2
- redis-6.4.0/tests/test_asyncio/test_ssl.py +56 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_timeseries.py +39 -0
- redis-6.4.0/tests/test_asyncio/test_utils.py +8 -0
- redis-6.4.0/tests/test_asyncio/test_vsets.py +884 -0
- redis-6.4.0/tests/test_auth/__init__.py +0 -0
- redis-6.4.0/tests/test_auth/test_token.py +76 -0
- redis-6.4.0/tests/test_auth/test_token_manager.py +558 -0
- redis-6.4.0/tests/test_backoff.py +18 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_bloom.py +28 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_cache.py +9 -8
- {redis-5.2.1 → redis-6.4.0}/tests/test_cluster.py +301 -109
- redis-6.4.0/tests/test_cluster_transaction.py +398 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_commands.py +488 -71
- {redis-5.2.1 → redis-6.4.0}/tests/test_connect.py +10 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_connection.py +17 -19
- {redis-5.2.1 → redis-6.4.0}/tests/test_connection_pool.py +85 -48
- redis-6.4.0/tests/test_credentials.py +675 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_hash.py +247 -0
- redis-6.4.0/tests/test_helpers.py +42 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_lock.py +31 -4
- redis-6.4.0/tests/test_max_connections_error.py +112 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_multiprocessing.py +54 -10
- {redis-5.2.1 → redis-6.4.0}/tests/test_pipeline.py +16 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_pubsub.py +7 -8
- {redis-5.2.1 → redis-6.4.0}/tests/test_retry.py +76 -5
- {redis-5.2.1 → redis-6.4.0}/tests/test_search.py +1260 -84
- {redis-5.2.1 → redis-6.4.0}/tests/test_sentinel.py +83 -7
- redis-6.4.0/tests/test_sentinel_managed_connection.py +34 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_ssl.py +30 -1
- {redis-5.2.1 → redis-6.4.0}/tests/test_timeseries.py +38 -1
- {redis-5.2.1 → redis-6.4.0}/tests/test_utils.py +7 -0
- redis-6.4.0/tests/test_vsets.py +882 -0
- redis-5.2.1/INSTALL +0 -6
- redis-5.2.1/MANIFEST.in +0 -6
- redis-5.2.1/README.md +0 -172
- redis-5.2.1/redis/commands/graph/__init__.py +0 -263
- redis-5.2.1/redis/commands/graph/commands.py +0 -313
- redis-5.2.1/redis/commands/graph/edge.py +0 -91
- redis-5.2.1/redis/commands/graph/exceptions.py +0 -3
- redis-5.2.1/redis/commands/graph/execution_plan.py +0 -211
- redis-5.2.1/redis/commands/graph/node.py +0 -88
- redis-5.2.1/redis/commands/graph/path.py +0 -78
- redis-5.2.1/redis/commands/graph/query_result.py +0 -588
- redis-5.2.1/redis/commands/json/_util.py +0 -3
- redis-5.2.1/redis/credentials.py +0 -26
- redis-5.2.1/redis.egg-info/SOURCES.txt +0 -148
- redis-5.2.1/redis.egg-info/dependency_links.txt +0 -1
- redis-5.2.1/redis.egg-info/requires.txt +0 -11
- redis-5.2.1/redis.egg-info/top_level.txt +0 -1
- redis-5.2.1/setup.cfg +0 -4
- redis-5.2.1/setup.py +0 -62
- redis-5.2.1/tests/test_asyncio/test_credentials.py +0 -283
- redis-5.2.1/tests/test_asyncio/test_graph.py +0 -527
- redis-5.2.1/tests/test_credentials.py +0 -250
- redis-5.2.1/tests/test_graph.py +0 -657
- redis-5.2.1/tests/test_graph_utils/test_edge.py +0 -75
- redis-5.2.1/tests/test_graph_utils/test_node.py +0 -51
- redis-5.2.1/tests/test_graph_utils/test_path.py +0 -90
- redis-5.2.1/tests/test_helpers.py +0 -90
- {redis-5.2.1 → redis-6.4.0}/LICENSE +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/commands.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/encoders.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/resp2.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/_parsers/socket.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/asyncio/__init__.py +0 -0
- {redis-5.2.1/tests → redis-6.4.0/redis/auth}/__init__.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/cache.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/__init__.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/bf/__init__.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/bf/commands.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/bf/info.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/json/decoders.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/json/path.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/__init__.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/_util.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/document.py +0 -0
- /redis-5.2.1/redis/commands/search/indexDefinition.py → /redis-6.4.0/redis/commands/search/index_definition.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/querystring.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/reducers.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/result.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/search/suggestion.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/timeseries/commands.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/timeseries/info.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/commands/timeseries/utils.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/redis/crc.py +0 -0
- /redis-5.2.1/tests/test_asyncio/__init__.py → /redis-6.4.0/redis/py.typed +0 -0
- {redis-5.2.1/tests/test_graph_utils → redis-6.4.0/tests}/__init__.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/mocks.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/ssl_utils.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/mocks.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_cwe_404.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_json.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/test_monitor.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/testdata/jsontestdata.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/testdata/titles.csv +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_asyncio/testdata/will_play_text.csv.bz2 +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_command_parser.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_encoding.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_function.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_json.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_monitor.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_parsers/test_helpers.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/test_scripting.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/testdata/jsontestdata.py +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/testdata/titles.csv +0 -0
- {redis-5.2.1 → redis-6.4.0}/tests/testdata/will_play_text.csv.bz2 +0 -0
redis-6.4.0/.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
*.pyc
|
|
2
|
+
redis.egg-info
|
|
3
|
+
build/
|
|
4
|
+
dist/
|
|
5
|
+
dump.rdb
|
|
6
|
+
_build
|
|
7
|
+
vagrant/.vagrant
|
|
8
|
+
.python-version
|
|
9
|
+
.cache
|
|
10
|
+
.eggs
|
|
11
|
+
.idea
|
|
12
|
+
.vscode
|
|
13
|
+
.coverage
|
|
14
|
+
env
|
|
15
|
+
venv
|
|
16
|
+
coverage.xml
|
|
17
|
+
.venv*
|
|
18
|
+
*.xml
|
|
19
|
+
.coverage*
|
|
20
|
+
prof
|
|
21
|
+
profile_output*
|
|
22
|
+
docker/stunnel/keys
|
|
23
|
+
/dockers/*/node-*/*
|
|
24
|
+
/dockers/*/tls/*
|
|
25
|
+
/dockers/standalone/
|
|
26
|
+
/dockers/cluster/
|
|
27
|
+
/dockers/replica/
|
|
28
|
+
/dockers/sentinel/
|
|
29
|
+
/dockers/redis-stack/
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: redis
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.4.0
|
|
4
4
|
Summary: Python client for Redis database and key-value store
|
|
5
|
-
Home-page: https://github.com/redis/redis-py
|
|
6
|
-
Author: Redis Inc.
|
|
7
|
-
Author-email: oss@redis.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Documentation, https://redis.readthedocs.io/en/latest/
|
|
10
5
|
Project-URL: Changes, https://github.com/redis/redis-py/releases
|
|
11
6
|
Project-URL: Code, https://github.com/redis/redis-py
|
|
7
|
+
Project-URL: Documentation, https://redis.readthedocs.io/en/latest/
|
|
8
|
+
Project-URL: Homepage, https://github.com/redis/redis-py
|
|
12
9
|
Project-URL: Issue tracker, https://github.com/redis/redis-py/issues
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
Author-email: "Redis Inc." <oss@redis.com>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: Redis,database,key-value-store
|
|
15
14
|
Classifier: Development Status :: 5 - Production/Stable
|
|
16
15
|
Classifier: Environment :: Console
|
|
17
16
|
Classifier: Intended Audience :: Developers
|
|
@@ -20,25 +19,31 @@ Classifier: Operating System :: OS Independent
|
|
|
20
19
|
Classifier: Programming Language :: Python
|
|
21
20
|
Classifier: Programming Language :: Python :: 3
|
|
22
21
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
24
22
|
Classifier: Programming Language :: Python :: 3.9
|
|
25
23
|
Classifier: Programming Language :: Python :: 3.10
|
|
26
24
|
Classifier: Programming Language :: Python :: 3.11
|
|
27
25
|
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
28
27
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
29
28
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
30
|
-
Requires-Python: >=3.
|
|
31
|
-
|
|
29
|
+
Requires-Python: >=3.9
|
|
30
|
+
Requires-Dist: async-timeout>=4.0.3; python_full_version < '3.11.3'
|
|
32
31
|
Provides-Extra: hiredis
|
|
32
|
+
Requires-Dist: hiredis>=3.2.0; extra == 'hiredis'
|
|
33
|
+
Provides-Extra: jwt
|
|
34
|
+
Requires-Dist: pyjwt>=2.9.0; extra == 'jwt'
|
|
33
35
|
Provides-Extra: ocsp
|
|
34
|
-
|
|
36
|
+
Requires-Dist: cryptography>=36.0.1; extra == 'ocsp'
|
|
37
|
+
Requires-Dist: pyopenssl>=20.0.1; extra == 'ocsp'
|
|
38
|
+
Requires-Dist: requests>=2.31.0; extra == 'ocsp'
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
35
40
|
|
|
36
41
|
# redis-py
|
|
37
42
|
|
|
38
43
|
The Python interface to the Redis key-value store.
|
|
39
44
|
|
|
40
45
|
[](https://github.com/redis/redis-py/actions?query=workflow%3ACI+branch%3Amaster)
|
|
41
|
-
[](https://redis
|
|
46
|
+
[](https://redis.readthedocs.io/en/stable/)
|
|
42
47
|
[](./LICENSE)
|
|
43
48
|
[](https://pypi.org/project/redis/)
|
|
44
49
|
[](https://github.com/redis/redis-py/releases)
|
|
@@ -48,13 +53,13 @@ The Python interface to the Redis key-value store.
|
|
|
48
53
|
|
|
49
54
|
---------------------------------------------
|
|
50
55
|
|
|
51
|
-
**Note
|
|
52
|
-
|
|
56
|
+
**Note:** redis-py 5.0 will be the last version of redis-py to support Python 3.7, as it has reached [end of life](https://devguide.python.org/versions/). redis-py 5.1 will support Python 3.8+.
|
|
57
|
+
**Note:** redis-py 6.1.0 will be the last version of redis-py to support Python 3.8, as it has reached [end of life](https://devguide.python.org/versions/). redis-py 6.2.0 will support Python 3.9+.
|
|
53
58
|
---------------------------------------------
|
|
54
59
|
|
|
55
60
|
## How do I Redis?
|
|
56
61
|
|
|
57
|
-
[Learn for free at Redis University](https://redis.io/university
|
|
62
|
+
[Learn for free at Redis University](https://redis.io/learn/university)
|
|
58
63
|
|
|
59
64
|
[Try the Redis Cloud](https://redis.io/try-free/)
|
|
60
65
|
|
|
@@ -66,12 +71,17 @@ The Python interface to the Redis key-value store.
|
|
|
66
71
|
|
|
67
72
|
## Installation
|
|
68
73
|
|
|
69
|
-
Start a redis via docker:
|
|
74
|
+
Start a redis via docker (for Redis versions >= 8.0):
|
|
70
75
|
|
|
71
76
|
``` bash
|
|
72
|
-
docker run -p 6379:6379 -it redis
|
|
77
|
+
docker run -p 6379:6379 -it redis:latest
|
|
73
78
|
```
|
|
74
79
|
|
|
80
|
+
Start a redis via docker (for Redis versions < 8.0):
|
|
81
|
+
|
|
82
|
+
``` bash
|
|
83
|
+
docker run -p 6379:6379 -it redis/redis-stack:latest
|
|
84
|
+
```
|
|
75
85
|
To install redis-py, simply:
|
|
76
86
|
|
|
77
87
|
``` bash
|
|
@@ -89,7 +99,7 @@ Looking for a high-level library to handle object mapping? See [redis-om-python]
|
|
|
89
99
|
|
|
90
100
|
## Supported Redis Versions
|
|
91
101
|
|
|
92
|
-
The most recent version of this library supports
|
|
102
|
+
The most recent version of this library supports Redis version [7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES), [7.4](https://github.com/redis/redis/blob/7.4/00-RELEASENOTES) and [8.0](https://github.com/redis/redis/blob/8.0/00-RELEASENOTES).
|
|
93
103
|
|
|
94
104
|
The table below highlights version compatibility of the most-recent library versions and redis versions.
|
|
95
105
|
|
|
@@ -97,7 +107,8 @@ The table below highlights version compatibility of the most-recent library vers
|
|
|
97
107
|
|-----------------|-------------------|
|
|
98
108
|
| 3.5.3 | <= 6.2 Family of releases |
|
|
99
109
|
| >= 4.5.0 | Version 5.0 to 7.0 |
|
|
100
|
-
| >= 5.0.0 | Version 5.0 to
|
|
110
|
+
| >= 5.0.0 | Version 5.0 to 7.4 |
|
|
111
|
+
| >= 6.0.0 | Version 7.2 to current |
|
|
101
112
|
|
|
102
113
|
|
|
103
114
|
## Usage
|
|
@@ -187,8 +198,42 @@ The following example shows how to utilize [Redis Pub/Sub](https://redis.io/docs
|
|
|
187
198
|
{'pattern': None, 'type': 'subscribe', 'channel': b'my-second-channel', 'data': 1}
|
|
188
199
|
```
|
|
189
200
|
|
|
201
|
+
### Redis’ search and query capabilities default dialect
|
|
190
202
|
|
|
191
|
-
|
|
203
|
+
Release 6.0.0 introduces a client-side default dialect for Redis’ search and query capabilities.
|
|
204
|
+
By default, the client now overrides the server-side dialect with version 2, automatically appending *DIALECT 2* to commands like *FT.AGGREGATE* and *FT.SEARCH*.
|
|
205
|
+
|
|
206
|
+
**Important**: Be aware that the query dialect may impact the results returned. If needed, you can revert to a different dialect version by configuring the client accordingly.
|
|
207
|
+
|
|
208
|
+
``` python
|
|
209
|
+
>>> from redis.commands.search.field import TextField
|
|
210
|
+
>>> from redis.commands.search.query import Query
|
|
211
|
+
>>> from redis.commands.search.index_definition import IndexDefinition
|
|
212
|
+
>>> import redis
|
|
213
|
+
|
|
214
|
+
>>> r = redis.Redis(host='localhost', port=6379, db=0)
|
|
215
|
+
>>> r.ft().create_index(
|
|
216
|
+
>>> (TextField("name"), TextField("lastname")),
|
|
217
|
+
>>> definition=IndexDefinition(prefix=["test:"]),
|
|
218
|
+
>>> )
|
|
219
|
+
|
|
220
|
+
>>> r.hset("test:1", "name", "James")
|
|
221
|
+
>>> r.hset("test:1", "lastname", "Brown")
|
|
222
|
+
|
|
223
|
+
>>> # Query with default DIALECT 2
|
|
224
|
+
>>> query = "@name: James Brown"
|
|
225
|
+
>>> q = Query(query)
|
|
226
|
+
>>> res = r.ft().search(q)
|
|
227
|
+
|
|
228
|
+
>>> # Query with explicit DIALECT 1
|
|
229
|
+
>>> query = "@name: James Brown"
|
|
230
|
+
>>> q = Query(query).dialect(1)
|
|
231
|
+
>>> res = r.ft().search(q)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
You can find further details in the [query dialect documentation](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/).
|
|
235
|
+
|
|
236
|
+
---------------------------------------------
|
|
192
237
|
|
|
193
238
|
### Author
|
|
194
239
|
|
|
@@ -205,4 +250,3 @@ Special thanks to:
|
|
|
205
250
|
- Paul Hubbard for initial packaging support.
|
|
206
251
|
|
|
207
252
|
[](https://redis.io)
|
|
208
|
-
|
|
@@ -1,44 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: redis
|
|
3
|
-
Version: 5.2.1
|
|
4
|
-
Summary: Python client for Redis database and key-value store
|
|
5
|
-
Home-page: https://github.com/redis/redis-py
|
|
6
|
-
Author: Redis Inc.
|
|
7
|
-
Author-email: oss@redis.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Documentation, https://redis.readthedocs.io/en/latest/
|
|
10
|
-
Project-URL: Changes, https://github.com/redis/redis-py/releases
|
|
11
|
-
Project-URL: Code, https://github.com/redis/redis-py
|
|
12
|
-
Project-URL: Issue tracker, https://github.com/redis/redis-py/issues
|
|
13
|
-
Keywords: Redis,key-value store,database
|
|
14
|
-
Platform: UNKNOWN
|
|
15
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
-
Classifier: Environment :: Console
|
|
17
|
-
Classifier: Intended Audience :: Developers
|
|
18
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
-
Classifier: Operating System :: OS Independent
|
|
20
|
-
Classifier: Programming Language :: Python
|
|
21
|
-
Classifier: Programming Language :: Python :: 3
|
|
22
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
27
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
28
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
29
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
30
|
-
Requires-Python: >=3.8
|
|
31
|
-
Description-Content-Type: text/markdown
|
|
32
|
-
Provides-Extra: hiredis
|
|
33
|
-
Provides-Extra: ocsp
|
|
34
|
-
License-File: LICENSE
|
|
35
|
-
|
|
36
1
|
# redis-py
|
|
37
2
|
|
|
38
3
|
The Python interface to the Redis key-value store.
|
|
39
4
|
|
|
40
5
|
[](https://github.com/redis/redis-py/actions?query=workflow%3ACI+branch%3Amaster)
|
|
41
|
-
[](https://redis
|
|
6
|
+
[](https://redis.readthedocs.io/en/stable/)
|
|
42
7
|
[](./LICENSE)
|
|
43
8
|
[](https://pypi.org/project/redis/)
|
|
44
9
|
[](https://github.com/redis/redis-py/releases)
|
|
@@ -48,13 +13,13 @@ The Python interface to the Redis key-value store.
|
|
|
48
13
|
|
|
49
14
|
---------------------------------------------
|
|
50
15
|
|
|
51
|
-
**Note
|
|
52
|
-
|
|
16
|
+
**Note:** redis-py 5.0 will be the last version of redis-py to support Python 3.7, as it has reached [end of life](https://devguide.python.org/versions/). redis-py 5.1 will support Python 3.8+.
|
|
17
|
+
**Note:** redis-py 6.1.0 will be the last version of redis-py to support Python 3.8, as it has reached [end of life](https://devguide.python.org/versions/). redis-py 6.2.0 will support Python 3.9+.
|
|
53
18
|
---------------------------------------------
|
|
54
19
|
|
|
55
20
|
## How do I Redis?
|
|
56
21
|
|
|
57
|
-
[Learn for free at Redis University](https://redis.io/university
|
|
22
|
+
[Learn for free at Redis University](https://redis.io/learn/university)
|
|
58
23
|
|
|
59
24
|
[Try the Redis Cloud](https://redis.io/try-free/)
|
|
60
25
|
|
|
@@ -66,12 +31,17 @@ The Python interface to the Redis key-value store.
|
|
|
66
31
|
|
|
67
32
|
## Installation
|
|
68
33
|
|
|
69
|
-
Start a redis via docker:
|
|
34
|
+
Start a redis via docker (for Redis versions >= 8.0):
|
|
70
35
|
|
|
71
36
|
``` bash
|
|
72
|
-
docker run -p 6379:6379 -it redis
|
|
37
|
+
docker run -p 6379:6379 -it redis:latest
|
|
73
38
|
```
|
|
74
39
|
|
|
40
|
+
Start a redis via docker (for Redis versions < 8.0):
|
|
41
|
+
|
|
42
|
+
``` bash
|
|
43
|
+
docker run -p 6379:6379 -it redis/redis-stack:latest
|
|
44
|
+
```
|
|
75
45
|
To install redis-py, simply:
|
|
76
46
|
|
|
77
47
|
``` bash
|
|
@@ -89,7 +59,7 @@ Looking for a high-level library to handle object mapping? See [redis-om-python]
|
|
|
89
59
|
|
|
90
60
|
## Supported Redis Versions
|
|
91
61
|
|
|
92
|
-
The most recent version of this library supports
|
|
62
|
+
The most recent version of this library supports Redis version [7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES), [7.4](https://github.com/redis/redis/blob/7.4/00-RELEASENOTES) and [8.0](https://github.com/redis/redis/blob/8.0/00-RELEASENOTES).
|
|
93
63
|
|
|
94
64
|
The table below highlights version compatibility of the most-recent library versions and redis versions.
|
|
95
65
|
|
|
@@ -97,7 +67,8 @@ The table below highlights version compatibility of the most-recent library vers
|
|
|
97
67
|
|-----------------|-------------------|
|
|
98
68
|
| 3.5.3 | <= 6.2 Family of releases |
|
|
99
69
|
| >= 4.5.0 | Version 5.0 to 7.0 |
|
|
100
|
-
| >= 5.0.0 | Version 5.0 to
|
|
70
|
+
| >= 5.0.0 | Version 5.0 to 7.4 |
|
|
71
|
+
| >= 6.0.0 | Version 7.2 to current |
|
|
101
72
|
|
|
102
73
|
|
|
103
74
|
## Usage
|
|
@@ -187,8 +158,42 @@ The following example shows how to utilize [Redis Pub/Sub](https://redis.io/docs
|
|
|
187
158
|
{'pattern': None, 'type': 'subscribe', 'channel': b'my-second-channel', 'data': 1}
|
|
188
159
|
```
|
|
189
160
|
|
|
161
|
+
### Redis’ search and query capabilities default dialect
|
|
162
|
+
|
|
163
|
+
Release 6.0.0 introduces a client-side default dialect for Redis’ search and query capabilities.
|
|
164
|
+
By default, the client now overrides the server-side dialect with version 2, automatically appending *DIALECT 2* to commands like *FT.AGGREGATE* and *FT.SEARCH*.
|
|
165
|
+
|
|
166
|
+
**Important**: Be aware that the query dialect may impact the results returned. If needed, you can revert to a different dialect version by configuring the client accordingly.
|
|
167
|
+
|
|
168
|
+
``` python
|
|
169
|
+
>>> from redis.commands.search.field import TextField
|
|
170
|
+
>>> from redis.commands.search.query import Query
|
|
171
|
+
>>> from redis.commands.search.index_definition import IndexDefinition
|
|
172
|
+
>>> import redis
|
|
173
|
+
|
|
174
|
+
>>> r = redis.Redis(host='localhost', port=6379, db=0)
|
|
175
|
+
>>> r.ft().create_index(
|
|
176
|
+
>>> (TextField("name"), TextField("lastname")),
|
|
177
|
+
>>> definition=IndexDefinition(prefix=["test:"]),
|
|
178
|
+
>>> )
|
|
179
|
+
|
|
180
|
+
>>> r.hset("test:1", "name", "James")
|
|
181
|
+
>>> r.hset("test:1", "lastname", "Brown")
|
|
182
|
+
|
|
183
|
+
>>> # Query with default DIALECT 2
|
|
184
|
+
>>> query = "@name: James Brown"
|
|
185
|
+
>>> q = Query(query)
|
|
186
|
+
>>> res = r.ft().search(q)
|
|
187
|
+
|
|
188
|
+
>>> # Query with explicit DIALECT 1
|
|
189
|
+
>>> query = "@name: James Brown"
|
|
190
|
+
>>> q = Query(query).dialect(1)
|
|
191
|
+
>>> res = r.ft().search(q)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
You can find further details in the [query dialect documentation](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/).
|
|
190
195
|
|
|
191
|
-
|
|
196
|
+
---------------------------------------------
|
|
192
197
|
|
|
193
198
|
### Author
|
|
194
199
|
|
|
@@ -205,4 +210,3 @@ Special thanks to:
|
|
|
205
210
|
- Paul Hubbard for initial packaging support.
|
|
206
211
|
|
|
207
212
|
[](https://redis.io)
|
|
208
|
-
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
build
|
|
2
|
+
click==8.0.4
|
|
3
|
+
invoke==2.2.0
|
|
4
|
+
mock
|
|
5
|
+
packaging>=20.4
|
|
6
|
+
pytest
|
|
7
|
+
pytest-asyncio>=0.23.0
|
|
8
|
+
pytest-cov
|
|
9
|
+
pytest-profiling==1.8.1
|
|
10
|
+
pytest-timeout
|
|
11
|
+
ruff==0.9.6
|
|
12
|
+
ujson>=4.2.0
|
|
13
|
+
uvloop
|
|
14
|
+
vulture>=2.3.0
|
|
15
|
+
numpy>=1.24.0
|
|
16
|
+
redis-entraid==1.0.0
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "redis"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Python client for Redis database and key-value store"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [{ name = "Redis Inc.", email = "oss@redis.com" }]
|
|
13
|
+
keywords = ["Redis", "database", "key-value-store"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
29
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
30
|
+
]
|
|
31
|
+
dependencies = ['async-timeout>=4.0.3; python_full_version<"3.11.3"']
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
hiredis = [
|
|
35
|
+
"hiredis>=3.2.0",
|
|
36
|
+
]
|
|
37
|
+
ocsp = [
|
|
38
|
+
"cryptography>=36.0.1",
|
|
39
|
+
"pyopenssl>=20.0.1",
|
|
40
|
+
"requests>=2.31.0",
|
|
41
|
+
]
|
|
42
|
+
jwt = [
|
|
43
|
+
"PyJWT>=2.9.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Changes = "https://github.com/redis/redis-py/releases"
|
|
48
|
+
Code = "https://github.com/redis/redis-py"
|
|
49
|
+
Documentation = "https://redis.readthedocs.io/en/latest/"
|
|
50
|
+
Homepage = "https://github.com/redis/redis-py"
|
|
51
|
+
"Issue tracker" = "https://github.com/redis/redis-py/issues"
|
|
52
|
+
|
|
53
|
+
[tool.hatch.version]
|
|
54
|
+
path = "redis/__init__.py"
|
|
55
|
+
|
|
56
|
+
[tool.hatch.build.targets.sdist]
|
|
57
|
+
include = ["/redis", "/tests", "dev_requirements.txt"]
|
|
58
|
+
|
|
59
|
+
[tool.hatch.build.targets.wheel]
|
|
60
|
+
include = ["/redis"]
|
|
61
|
+
|
|
62
|
+
[tool.pytest.ini_options]
|
|
63
|
+
addopts = "-s"
|
|
64
|
+
markers = [
|
|
65
|
+
"redismod: run only the redis module tests",
|
|
66
|
+
"pipeline: pipeline tests",
|
|
67
|
+
"onlycluster: marks tests to be run only with cluster mode redis",
|
|
68
|
+
"onlynoncluster: marks tests to be run only with standalone redis",
|
|
69
|
+
"ssl: marker for only the ssl tests",
|
|
70
|
+
"asyncio: marker for async tests",
|
|
71
|
+
"replica: replica tests",
|
|
72
|
+
"experimental: run only experimental tests",
|
|
73
|
+
"cp_integration: credential provider integration tests",
|
|
74
|
+
]
|
|
75
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
76
|
+
asyncio_mode = "auto"
|
|
77
|
+
timeout = 30
|
|
78
|
+
filterwarnings = [
|
|
79
|
+
"always",
|
|
80
|
+
# Ignore a coverage warning when COVERAGE_CORE=sysmon for Pythons < 3.12.
|
|
81
|
+
"ignore:sys.monitoring isn't available:coverage.exceptions.CoverageWarning",
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
[tool.ruff]
|
|
85
|
+
target-version = "py39"
|
|
86
|
+
line-length = 88
|
|
87
|
+
exclude = [
|
|
88
|
+
"*.egg-info",
|
|
89
|
+
"*.pyc",
|
|
90
|
+
".git",
|
|
91
|
+
".venv*",
|
|
92
|
+
"build",
|
|
93
|
+
"dist",
|
|
94
|
+
"docker",
|
|
95
|
+
"docs/*",
|
|
96
|
+
"doctests/*",
|
|
97
|
+
"tasks.py",
|
|
98
|
+
"venv*",
|
|
99
|
+
"whitelist.py",
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[tool.ruff.lint]
|
|
103
|
+
ignore = [
|
|
104
|
+
"E501", # line too long (taken care of with ruff format)
|
|
105
|
+
"E741", # ambiguous variable name
|
|
106
|
+
"N818", # Errors should have Error suffix
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
select = ["E", "F", "FLY", "I", "N", "W"]
|
|
110
|
+
|
|
111
|
+
[tool.ruff.lint.per-file-ignores]
|
|
112
|
+
"redis/commands/bf/*" = [
|
|
113
|
+
# the `bf` module uses star imports, so this is required there.
|
|
114
|
+
"F405", # name may be undefined, or defined from star imports
|
|
115
|
+
]
|
|
116
|
+
"redis/commands/{bf,timeseries,json,search}/*" = ["N"]
|
|
117
|
+
"tests/*" = [
|
|
118
|
+
"I", # TODO: could be enabled, plenty of changes
|
|
119
|
+
"N801", # class name should use CapWords convention
|
|
120
|
+
"N803", # argument name should be lowercase
|
|
121
|
+
"N802", # function name should be lowercase
|
|
122
|
+
"N806", # variable name should be lowercase
|
|
123
|
+
]
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from importlib import metadata
|
|
2
|
-
|
|
3
1
|
from redis import asyncio # noqa
|
|
4
2
|
from redis.backoff import default_backoff
|
|
5
3
|
from redis.client import Redis, StrictRedis
|
|
@@ -18,11 +16,15 @@ from redis.exceptions import (
|
|
|
18
16
|
BusyLoadingError,
|
|
19
17
|
ChildDeadlockedError,
|
|
20
18
|
ConnectionError,
|
|
19
|
+
CrossSlotTransactionError,
|
|
21
20
|
DataError,
|
|
21
|
+
InvalidPipelineStack,
|
|
22
22
|
InvalidResponse,
|
|
23
|
+
MaxConnectionsError,
|
|
23
24
|
OutOfMemoryError,
|
|
24
25
|
PubSubError,
|
|
25
26
|
ReadOnlyError,
|
|
27
|
+
RedisClusterException,
|
|
26
28
|
RedisError,
|
|
27
29
|
ResponseError,
|
|
28
30
|
TimeoutError,
|
|
@@ -44,16 +46,9 @@ def int_or_str(value):
|
|
|
44
46
|
return value
|
|
45
47
|
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
except metadata.PackageNotFoundError:
|
|
50
|
-
__version__ = "99.99.99"
|
|
51
|
-
|
|
49
|
+
__version__ = "6.4.0"
|
|
50
|
+
VERSION = tuple(map(int_or_str, __version__.split(".")))
|
|
52
51
|
|
|
53
|
-
try:
|
|
54
|
-
VERSION = tuple(map(int_or_str, __version__.split(".")))
|
|
55
|
-
except AttributeError:
|
|
56
|
-
VERSION = tuple([99, 99, 99])
|
|
57
52
|
|
|
58
53
|
__all__ = [
|
|
59
54
|
"AuthenticationError",
|
|
@@ -65,15 +60,19 @@ __all__ = [
|
|
|
65
60
|
"ConnectionError",
|
|
66
61
|
"ConnectionPool",
|
|
67
62
|
"CredentialProvider",
|
|
63
|
+
"CrossSlotTransactionError",
|
|
68
64
|
"DataError",
|
|
69
65
|
"from_url",
|
|
70
66
|
"default_backoff",
|
|
67
|
+
"InvalidPipelineStack",
|
|
71
68
|
"InvalidResponse",
|
|
69
|
+
"MaxConnectionsError",
|
|
72
70
|
"OutOfMemoryError",
|
|
73
71
|
"PubSubError",
|
|
74
72
|
"ReadOnlyError",
|
|
75
73
|
"Redis",
|
|
76
74
|
"RedisCluster",
|
|
75
|
+
"RedisClusterException",
|
|
77
76
|
"RedisError",
|
|
78
77
|
"ResponseError",
|
|
79
78
|
"Sentinel",
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
from .base import
|
|
1
|
+
from .base import (
|
|
2
|
+
AsyncPushNotificationsParser,
|
|
3
|
+
BaseParser,
|
|
4
|
+
PushNotificationsParser,
|
|
5
|
+
_AsyncRESPBase,
|
|
6
|
+
)
|
|
2
7
|
from .commands import AsyncCommandsParser, CommandsParser
|
|
3
8
|
from .encoders import Encoder
|
|
4
9
|
from .hiredis import _AsyncHiredisParser, _HiredisParser
|
|
@@ -11,10 +16,12 @@ __all__ = [
|
|
|
11
16
|
"_AsyncRESPBase",
|
|
12
17
|
"_AsyncRESP2Parser",
|
|
13
18
|
"_AsyncRESP3Parser",
|
|
19
|
+
"AsyncPushNotificationsParser",
|
|
14
20
|
"CommandsParser",
|
|
15
21
|
"Encoder",
|
|
16
22
|
"BaseParser",
|
|
17
23
|
"_HiredisParser",
|
|
18
24
|
"_RESP2Parser",
|
|
19
25
|
"_RESP3Parser",
|
|
26
|
+
"PushNotificationsParser",
|
|
20
27
|
]
|