A Redis-backed persistent Python dictionary
Project description
redis-json-dict
Usage
>>> import redis
... redis_client = redis.Redis("localhost", 6379)
... d = RedisJSONDict(redis_client, prefix="my_dict")
... d
{}
All user modifications, including mutation of nested lists or dicts, are immediately synchronized to the Redis server.
Design Requirements
- The dictionary implements Python's
collections.abc.MutableMappinginterface. - All values stored in Redis are JSON-encoded, readily inspected with developer eyeballs and possible to operate on from clients in languages other than Python.
- Keys may be prefixed to reduce the likelihood of collisions when one Redis is shared by multiple applications.
- No data is cached locally, so it is impossible to obtain a stale result.
However, the dictionary may be composed with other libraries, such as
cachetools, to implement TTL caching for example. - Top-level items like
d['sample']may be accessed without synchronizing the entire dictionary. Nested objects liked['sample']['color']are supported (but may be less efficient). - Mutating nested items, with operations like
d['sample']['color'] = 'red'ord['sample']['positions'].append(3)triggers synchronization.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file redis_json_dict-0.2.2.tar.gz.
File metadata
- Download URL: redis_json_dict-0.2.2.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
659c8ea71c81fae93f1ea328c357f1d1709395565bc8ca7b5410d44b4f271a70
|
|
| MD5 |
6cd63336a5320ddfa6be25c3bbc4a8de
|
|
| BLAKE2b-256 |
34e7de8be2bd19cbdb350d21836de2f56741aefc6cbf57478b31719c3e2856c3
|
Provenance
The following attestation bundles were made for redis_json_dict-0.2.2.tar.gz:
Publisher:
cd.yml on NSLS2/redis-json-dict
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_json_dict-0.2.2.tar.gz -
Subject digest:
659c8ea71c81fae93f1ea328c357f1d1709395565bc8ca7b5410d44b4f271a70 - Sigstore transparency entry: 820316262
- Sigstore integration time:
-
Permalink:
NSLS2/redis-json-dict@36faa463e3c18b2b0ad436a5653f262e3cb89918 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/NSLS2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@36faa463e3c18b2b0ad436a5653f262e3cb89918 -
Trigger Event:
release
-
Statement type:
File details
Details for the file redis_json_dict-0.2.2-py3-none-any.whl.
File metadata
- Download URL: redis_json_dict-0.2.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3654918541ebc0b5f77bf8aa7626217af3325f3f5451d9391c2d8cd35974decd
|
|
| MD5 |
c6ba8e75c54b6f496e89ee8bdc6c5620
|
|
| BLAKE2b-256 |
13b53515126cb6dce557cb928cc3147a77d5f84b9cade3c8548b802792e6bbe4
|
Provenance
The following attestation bundles were made for redis_json_dict-0.2.2-py3-none-any.whl:
Publisher:
cd.yml on NSLS2/redis-json-dict
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_json_dict-0.2.2-py3-none-any.whl -
Subject digest:
3654918541ebc0b5f77bf8aa7626217af3325f3f5451d9391c2d8cd35974decd - Sigstore transparency entry: 820316288
- Sigstore integration time:
-
Permalink:
NSLS2/redis-json-dict@36faa463e3c18b2b0ad436a5653f262e3cb89918 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/NSLS2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@36faa463e3c18b2b0ad436a5653f262e3cb89918 -
Trigger Event:
release
-
Statement type: