import json from redis import Redis rdb = Redis() d = {"key": "value"} rdb.set("Leo2021", json.dumps(d)) print(json.loads(rdb.get("Leo2021")))