redisdol
redis with a simple (dict-like or list-like) interface
To install: pip install redisdol
Provides a collections.abc.MutableMapping (i.e. dict-like) interface to Redis.
Note that Redis automatically converts everything to bytes when writing, which means that read and write are not inverse of each other in the base RedisPersister. A serialization/deserialization layer can be added to make read and write consistent.
>>> from redisdol import RedisBytesPersister
>>> s = RedisBytesPersister() # plenty of params possible (all those of redis.Redis), but taking defaults.
>>>
>>> # clear the kehys we'll be using
>>> keys = ['_pyst_test_str', '_pyst_test_int', '_pyst_test_float']
>>> for k in keys:
... del s[k]
>>>
>>> before_length = len(s)
>>>
>>> s['_pyst_test_str'] = 'hello'
>>> s['_pyst_test_str'] # note you won't be getting a str but bytes
b'hello'
>>>
>>> '_pyst_test_str' in s
>>>
>>> # numbers are converted to strings then bytes
>>> s['_pyst_test_int'] = 42
>>> assert s['_pyst_test_int'] == b'42'
>>> s['_pyst_test_float'] = 3.14
>>> assert s['_pyst_test_float'] == b'3.14'
>>>
>>> assert len(s) == before_length + 3
>>>
>>> '_pyst_test_float' in
>>>
>>> # clean up
>>> for k in keys:
... del s[k]
>>>
Metadata
Release files for redisdol 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| redisdol-0.0.9.tar.gz | 39.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| redisdol-0.0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.5 kB
Release files / redisdol-0.0.9.tar.gz
| Download URL | redisdol-0.0.9.tar.gz |
|---|---|
| Size | 39.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
333251bdba3f5b61c6317dd0050d182f13c32a3aa4b7cffce59e77130ca6ae61
|
|
BLAKE2b-256 checksum How to use checksums |
99fb52f550c2daef5843ca518684e74cbb42ee6073fdeb29c0b54b66ee2a21ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / redisdol-0.0.9-py3-none-any.whl
| Download URL | redisdol-0.0.9-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98dfd94982a46eecfcd1e1e9a3a13b4e58b11f45bb854944888f1aa0e65c7c27
|
|
BLAKE2b-256 checksum How to use checksums |
75f0dbfe8ffc527d94e11b5a0faa585395b1322940ad40eaf24b966798251791
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|