Yet another dictionary backed by Redis DB
Project description
persistentdict
Yet another [1] dictionary backed by Redis DB.
We use Redis` 'hash' type [2] and store whole dictionary in one hash.
Usage:
from persistentdict.dict_in_redis import PersistentDict
db = PersistentDict(hash_name="my-persistent-dict")
# add key to the db with a value
db['key'] = value
# show whole dictionary
print(db)
# iterate over keys & values in db
for key, value in db.items():
do_something(key)
# do sth with key if it is in db
if key in db:
do_something(key)
# delete key from db
del db['key']
Installation:
pip3 install persistentdict
[1] Alternatives: persistent-dict, durabledict
[2] https://redis.io/topics/data-types-intro#hashes is basically Python's dict, but values can be strings only, so we use json serialization
Project details
Release history Release notifications | RSS feed
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 persistentdict-1.0.1.tar.gz.
File metadata
- Download URL: persistentdict-1.0.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4077de2489a28a7757cb8afa32341811bbd7947249ea2cd0b0cf6c0bafc705ed
|
|
| MD5 |
1faffc2c972fb22ec7de082a24a32e1c
|
|
| BLAKE2b-256 |
4f190a4e80f0c00cb5b83111939daa3b25e4ab7068ecb7f761ec5020b8d0bac9
|
File details
Details for the file persistentdict-1.0.1-py3-none-any.whl.
File metadata
- Download URL: persistentdict-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e768ddd195ac9b9fb8fb0b6a3ebca477e13a8168d6a6cb03f5d381bc7a7c681c
|
|
| MD5 |
9bbaa4288a3fdc6a1048d585afa6ec4c
|
|
| BLAKE2b-256 |
2ab6c3c6f9927482652d4896e6fe71499f49458bd75f180d7f6e31db5b6420c8
|