
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
A Python shelve that uses Redis as storage.
In some contexts writing state to files can be hard. Redis can be a more suitable storage solution. If you need a shelve but cannot write to file and if you are friends with Redis already, you can use Redis Shelve.
Redis Shelve is licensed under LGPLv3. See the LICENSE file for details.
pip install redis-shelve
The behaviour of the Redis shelve should be similar to Python shelve. Instead of a filename, you can pass redis-shelve a redis instance. You can think of the configured redis database being similiar to a file in Python shelve.
import redisshelve
from redis import Redis
redis = Redis(db=15)
shelf = redisshelve.RedisShelf(redis=redis)
shelf['test'] = 'Test'
assert 'Test' == shelf['test']
assert 'Test' == shelf.get('test')
You can also use the redisshelve.open
context manager.
with redisshelve.open(redis=redis) as shelf:
shelf['foo'] = 'Bar'
By default, the keys you enter in the shelf are used as keys in Redis. If you think this might conflict with existing values, you can prefix your keys.
NB: As a side effect, if you also use writeback, the keys in the shelf's cache are also prefixed.
shelf = redisshelve.RedisShelf(redis=redis, key_prefix='my_prefix')
with redisshelve.open(redis=redis, key_prefix='my_prefix') as shelf:
shelf['foo'] = 'Bar'
Please see the tests for more examples.
unprefixed: tests/test_redisshelve_unprefixed.py
prefixed: tests/test_redisshelve_prefixed.py
FAQs
Unknown package
We found that redis-shelve demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.