Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redis-json-dict

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-json-dict

A Redis-backed persistent Python dictionary

  • 0.2.1
  • PyPI
  • Socket score

Maintainers
1

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc