redis-dict 2.5.0__tar.gz → 2.5.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {redis dict-2.5.0 → redis dict-2.5.1}/PKG-INFO +4 -3
- {redis dict-2.5.0 → redis dict-2.5.1}/README.md +3 -2
- {redis dict-2.5.0 → redis dict-2.5.1}/redis_dict.egg-info/PKG-INFO +4 -3
- {redis dict-2.5.0 → redis dict-2.5.1}/redis_dict.py +7 -7
- {redis dict-2.5.0 → redis dict-2.5.1}/setup.py +1 -2
- {redis dict-2.5.0 → redis dict-2.5.1}/LICENSE +0 -0
- {redis dict-2.5.0 → redis dict-2.5.1}/redis_dict.egg-info/SOURCES.txt +0 -0
- {redis dict-2.5.0 → redis dict-2.5.1}/redis_dict.egg-info/dependency_links.txt +0 -0
- {redis dict-2.5.0 → redis dict-2.5.1}/redis_dict.egg-info/requires.txt +0 -0
- {redis dict-2.5.0 → redis dict-2.5.1}/redis_dict.egg-info/top_level.txt +0 -0
- {redis dict-2.5.0 → redis dict-2.5.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: redis dict
|
3
|
-
Version: 2.5.
|
3
|
+
Version: 2.5.1
|
4
4
|
Summary: Dictionary with Redis as storage backend
|
5
5
|
Home-page: https://github.com/Attumm/redisdict
|
6
6
|
Author: Melvin Bijman
|
@@ -24,7 +24,8 @@ License-File: LICENSE
|
|
24
24
|
Requires-Dist: redis
|
25
25
|
|
26
26
|
# Redis-dict
|
27
|
-
[](https://github.com/Attumm/redis-dict/actions/workflows/ci.yml)
|
28
|
+
[](https://codecov.io/gh/Attumm/redis-dict)
|
28
29
|
[](https://pepy.tech/project/redis-dict)
|
29
30
|
|
30
31
|
RedisDict is a Python library that provides a convenient and familiar interface for interacting with Redis as if it were a Python dictionary. This simple yet powerful library enables you to manage key-value pairs in Redis using native Python syntax. It supports various data types, including strings, integers, floats, booleans, lists, and dictionaries, and includes additional utility functions for more complex use cases.
|
@@ -230,7 +231,7 @@ print(dic["d"]) # Output: 4
|
|
230
231
|
```
|
231
232
|
|
232
233
|
### Additional Examples
|
233
|
-
For more advanced examples of RedisDict, please refer to the unit-test files in the repository. All features and functionalities are thoroughly tested in [unit tests (here)](https://github.com/Attumm/redis-dict/blob/main/tests.py#L1) Or take a look at load test for batching [load test](https://github.com/Attumm/redis-dict/blob/main/load_test.py
|
234
|
+
For more advanced examples of RedisDict, please refer to the unit-test files in the repository. All features and functionalities are thoroughly tested in [unit tests (here)](https://github.com/Attumm/redis-dict/blob/main/tests.py#L1) Or take a look at load test for batching [load test](https://github.com/Attumm/redis-dict/blob/main/load_test.py#L1).
|
234
235
|
The unit-tests can be as used as a starting point.
|
235
236
|
|
236
237
|
### Redis Encryption
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# Redis-dict
|
2
|
-
[](https://github.com/Attumm/redis-dict/actions/workflows/ci.yml)
|
3
|
+
[](https://codecov.io/gh/Attumm/redis-dict)
|
3
4
|
[](https://pepy.tech/project/redis-dict)
|
4
5
|
|
5
6
|
RedisDict is a Python library that provides a convenient and familiar interface for interacting with Redis as if it were a Python dictionary. This simple yet powerful library enables you to manage key-value pairs in Redis using native Python syntax. It supports various data types, including strings, integers, floats, booleans, lists, and dictionaries, and includes additional utility functions for more complex use cases.
|
@@ -205,7 +206,7 @@ print(dic["d"]) # Output: 4
|
|
205
206
|
```
|
206
207
|
|
207
208
|
### Additional Examples
|
208
|
-
For more advanced examples of RedisDict, please refer to the unit-test files in the repository. All features and functionalities are thoroughly tested in [unit tests (here)](https://github.com/Attumm/redis-dict/blob/main/tests.py#L1) Or take a look at load test for batching [load test](https://github.com/Attumm/redis-dict/blob/main/load_test.py
|
209
|
+
For more advanced examples of RedisDict, please refer to the unit-test files in the repository. All features and functionalities are thoroughly tested in [unit tests (here)](https://github.com/Attumm/redis-dict/blob/main/tests.py#L1) Or take a look at load test for batching [load test](https://github.com/Attumm/redis-dict/blob/main/load_test.py#L1).
|
209
210
|
The unit-tests can be as used as a starting point.
|
210
211
|
|
211
212
|
### Redis Encryption
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: redis-dict
|
3
|
-
Version: 2.5.
|
3
|
+
Version: 2.5.1
|
4
4
|
Summary: Dictionary with Redis as storage backend
|
5
5
|
Home-page: https://github.com/Attumm/redisdict
|
6
6
|
Author: Melvin Bijman
|
@@ -24,7 +24,8 @@ License-File: LICENSE
|
|
24
24
|
Requires-Dist: redis
|
25
25
|
|
26
26
|
# Redis-dict
|
27
|
-
[](https://github.com/Attumm/redis-dict/actions/workflows/ci.yml)
|
28
|
+
[](https://codecov.io/gh/Attumm/redis-dict)
|
28
29
|
[](https://pepy.tech/project/redis-dict)
|
29
30
|
|
30
31
|
RedisDict is a Python library that provides a convenient and familiar interface for interacting with Redis as if it were a Python dictionary. This simple yet powerful library enables you to manage key-value pairs in Redis using native Python syntax. It supports various data types, including strings, integers, floats, booleans, lists, and dictionaries, and includes additional utility functions for more complex use cases.
|
@@ -230,7 +231,7 @@ print(dic["d"]) # Output: 4
|
|
230
231
|
```
|
231
232
|
|
232
233
|
### Additional Examples
|
233
|
-
For more advanced examples of RedisDict, please refer to the unit-test files in the repository. All features and functionalities are thoroughly tested in [unit tests (here)](https://github.com/Attumm/redis-dict/blob/main/tests.py#L1) Or take a look at load test for batching [load test](https://github.com/Attumm/redis-dict/blob/main/load_test.py
|
234
|
+
For more advanced examples of RedisDict, please refer to the unit-test files in the repository. All features and functionalities are thoroughly tested in [unit tests (here)](https://github.com/Attumm/redis-dict/blob/main/tests.py#L1) Or take a look at load test for batching [load test](https://github.com/Attumm/redis-dict/blob/main/load_test.py#L1).
|
234
235
|
The unit-tests can be as used as a starting point.
|
235
236
|
|
236
237
|
### Redis Encryption
|
@@ -131,7 +131,7 @@ class RedisDict:
|
|
131
131
|
Args:
|
132
132
|
namespace (str, optional): A prefix for keys stored in Redis.
|
133
133
|
expire (int, timedelta, optional): Expiration time for keys in seconds.
|
134
|
-
preserve_expiration (bool, optional):
|
134
|
+
preserve_expiration (bool, optional): Preserve the expiration count when the key is updated.
|
135
135
|
**redis_kwargs: Additional keyword arguments passed to StrictRedis.
|
136
136
|
"""
|
137
137
|
self.temp_redis: Optional[StrictRedis[Any]] = None
|
@@ -403,14 +403,14 @@ class RedisDict:
|
|
403
403
|
|
404
404
|
def iterkeys(self) -> Iterator[str]:
|
405
405
|
"""
|
406
|
-
Note: for
|
406
|
+
Note: for python2 str is needed
|
407
407
|
"""
|
408
408
|
to_rm = len(self.namespace) + 1
|
409
409
|
return (str(item[to_rm:]) for item in self._scan_keys())
|
410
410
|
|
411
411
|
def key(self, search_term: str = '') -> Optional[str]:
|
412
412
|
"""
|
413
|
-
Note: for
|
413
|
+
Note: for python2 str is needed
|
414
414
|
"""
|
415
415
|
to_rm = len(self.namespace) + 1
|
416
416
|
cursor, data = self.get_redis.scan(match='{}:{}{}'.format(self.namespace, search_term, '*'), count=1)
|
@@ -546,7 +546,7 @@ class RedisDict:
|
|
546
546
|
|
547
547
|
Args:
|
548
548
|
key (str): The key to retrieve the value.
|
549
|
-
|
549
|
+
default_value (Optional[Any], optional): The value to set if the key is not found.
|
550
550
|
|
551
551
|
Returns:
|
552
552
|
Any: The value associated with the key or the default value.
|
@@ -575,7 +575,7 @@ class RedisDict:
|
|
575
575
|
Update the RedisDict with key-value pairs from the given mapping, analogous to a dictionary's update method.
|
576
576
|
|
577
577
|
Args:
|
578
|
-
|
578
|
+
dic (Mapping[str, Any]): A mapping containing key-value pairs to update the RedisDict.
|
579
579
|
"""
|
580
580
|
with self.pipeline():
|
581
581
|
for key, value in dic.items():
|
@@ -746,13 +746,13 @@ class RedisDict:
|
|
746
746
|
def get_ttl(self, key: str) -> Optional[int]:
|
747
747
|
"""
|
748
748
|
Get the Time To Live (TTL) in seconds for a given key. If the key does not exist or does not have an
|
749
|
-
associated expire
|
749
|
+
associated `expire`, return None.
|
750
750
|
|
751
751
|
Args:
|
752
752
|
key (str): The key for which to get the TTL.
|
753
753
|
|
754
754
|
Returns:
|
755
|
-
Optional[int]: The TTL in seconds if the key exists and has an
|
755
|
+
Optional[int]: The TTL in seconds if the key exists and has an expiry set; otherwise, None.
|
756
756
|
"""
|
757
757
|
val = self.redis.ttl(self._format_key(key))
|
758
758
|
if val < 0:
|
@@ -17,7 +17,7 @@ setup(
|
|
17
17
|
long_description=long_description,
|
18
18
|
long_description_content_type='text/markdown',
|
19
19
|
|
20
|
-
version='2.5.
|
20
|
+
version='2.5.1',
|
21
21
|
py_modules=['redis_dict'],
|
22
22
|
install_requires=['redis',],
|
23
23
|
license='MIT',
|
@@ -44,4 +44,3 @@ setup(
|
|
44
44
|
'Programming Language :: Python :: 3.12',
|
45
45
|
],
|
46
46
|
)
|
47
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|