Stop worrying about serialization! Store (almost) anything on Redis without even thiking about it.
You can also check the last time you've modified a given key just by calling get_with_timestamp(key)
.
- Python 3.6.x, 3.7.x, 3.8.x and 3.9.x
- Ubuntu (probably all Debian-based distros)
- Redis 4.x, 5.x and 6.x
Other platforms or versions are not tested.
>>> import numpy as np
>>> from redis_pal import RedisPal
>>> rp = RedisPal()
>>> rp.set("test", np.array([1, 2, 3]))
True
>>> rp.get("test")
array([1, 2, 3])
>>> rp.get_with_timestamp("test")
{'value': array([1, 2, 3]), 'last_modified': 1613329082.33473}
As simple as running
pip3 install redis-pal