redis-dict 2.5.0__py3-none-any.whl → 2.5.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redis-dict
3
- Version: 2.5.0
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
- [![Build Status](https://travis-ci.com/Attumm/redis-dict.svg?branch=main)](https://travis-ci.com/Attumm/redis-dict)
27
+ [![CI](https://github.com/Attumm/redis-dict/actions/workflows/ci.yml/badge.svg)](https://github.com/Attumm/redis-dict/actions/workflows/ci.yml)
28
+ [![codecov](https://codecov.io/gh/Attumm/redis-dict/graph/badge.svg?token=Lqs7McQGEs)](https://codecov.io/gh/Attumm/redis-dict)
28
29
  [![Downloads](https://static.pepy.tech/badge/redis-dict/month)](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.py#L1).
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
@@ -0,0 +1,6 @@
1
+ redis_dict.py,sha256=ZQSg6bCaV_Ho18x7CtjYgD0kakFeskn3TfJzR3e0I28,25677
2
+ redis_dict-2.5.1.dist-info/LICENSE,sha256=-QiLwYznh_vNUSz337k0faP9Jl0dgtCIHVZ39Uyl6cA,1070
3
+ redis_dict-2.5.1.dist-info/METADATA,sha256=dKyus34pm_rQ-icVu7L53N_QzMSaxbLWhKuVSTh7RfI,10000
4
+ redis_dict-2.5.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
5
+ redis_dict-2.5.1.dist-info/top_level.txt,sha256=Wyp5Xvq_imoxvu-c-Le1rbTZ3pYM5BF440H9YAcgBZ8,11
6
+ redis_dict-2.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
redis_dict.py CHANGED
@@ -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): Whether or not to preserve the expiration.
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 pythone2 str is needed
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 pythone2 str is needed
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
- default (Optional[Any], optional): The value to set if the key is not found.
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
- other (Mapping[str, Any]): A mapping containing key-value pairs to update the RedisDict.
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, return None.
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 expire set; otherwise, None.
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:
@@ -1,6 +0,0 @@
1
- redis_dict.py,sha256=xB36Vby3FIIuSoRSqfTT1XuVXi-ZpQPHmUQoUf_HOTg,25661
2
- redis_dict-2.5.0.dist-info/LICENSE,sha256=-QiLwYznh_vNUSz337k0faP9Jl0dgtCIHVZ39Uyl6cA,1070
3
- redis_dict-2.5.0.dist-info/METADATA,sha256=e0bB_4MTF5C7lHFt0eRPqBRB2QocOJjmNDs80gaur7w,9847
4
- redis_dict-2.5.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
5
- redis_dict-2.5.0.dist-info/top_level.txt,sha256=Wyp5Xvq_imoxvu-c-Le1rbTZ3pYM5BF440H9YAcgBZ8,11
6
- redis_dict-2.5.0.dist-info/RECORD,,