https://github.com/richardarpanet/persistent-dict
📂 A Python dict which stores all data in Redis
https://github.com/richardarpanet/persistent-dict
dict dictionary python python-dict python-library python3 redis
Last synced: 2 months ago
JSON representation
📂 A Python dict which stores all data in Redis
- Host: GitHub
- URL: https://github.com/richardarpanet/persistent-dict
- Owner: richardARPANET
- License: mit
- Created: 2018-04-03T19:08:05.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T13:34:48.000Z (over 4 years ago)
- Last Synced: 2025-01-19T05:48:24.214Z (4 months ago)
- Topics: dict, dictionary, python, python-dict, python-library, python3, redis
- Language: Python
- Homepage: https://code.richard.do/richardARPANET/persistent-dict
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
README
**NOTICE**: If you're reading this on GitHub.com please be aware this is a mirror of the primary remote located at https://code.richard.do/explore/projects.
Please direct issues and pull requests there.# persistent-dict
[](https://pypi.python.org/pypi/persistent-dict)
[](https://pypi.python.org/pypi/persistent-dict)
[](https://travis-ci.org/richardasaurus/persistent-dict)A Python Dict which stores data in Redis.
You can use ``RedisDict`` exactly like a normal ``dict``. As long as all the keys and values in it are [picklable](https://docs.python.org/3/library/pickle.html).
## Installation
To install, simply:
```bash
pip install persistent-dict
```## How to use
```python
import redis
from persistentdict import RedisDictmydict = RedisDict(persistence=redis.StrictRedis())
# with a specific storage key in redis
mydict = RedisDict(persistence=redis.StrictRedis(), key='stuff')mydict['hello'] = 'world'
print(mydict)
{'hello': 'world'}
```## Future plans
- Support for other storage backends other than Redis.