Skip to main content

A Redis-backed persistent Python dictionary

Project description

redis-json-dict

Actions Status Documentation Status

PyPI version Conda-Forge PyPI platforms

GitHub Discussion

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.MutableMapping interface.
  • 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 like d['sample']['color'] are supported (but may be less efficient).
  • Mutating nested items, with operations like d['sample']['color'] = 'red' or d['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

redis_json_dict-0.2.2.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redis_json_dict-0.2.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for redis_json_dict-0.2.2.tar.gz
Algorithm Hash digest
SHA256 659c8ea71c81fae93f1ea328c357f1d1709395565bc8ca7b5410d44b4f271a70
MD5 6cd63336a5320ddfa6be25c3bbc4a8de
BLAKE2b-256 34e7de8be2bd19cbdb350d21836de2f56741aefc6cbf57478b31719c3e2856c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for redis_json_dict-0.2.2.tar.gz:

Publisher: cd.yml on NSLS2/redis-json-dict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redis_json_dict-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for redis_json_dict-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3654918541ebc0b5f77bf8aa7626217af3325f3f5451d9391c2d8cd35974decd
MD5 c6ba8e75c54b6f496e89ee8bdc6c5620
BLAKE2b-256 13b53515126cb6dce557cb928cc3147a77d5f84b9cade3c8548b802792e6bbe4

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page