Redis dictionary & list nesting for Python objects
Project description
RedNest
Redis dictionary & list nesting for Python objects using redis-py
and Redis Hash
es and List
s
Usage example
import redis
from rednest import Dictionary, List
# Initialize redis connection
redis = redis.Redis(...)
# Create your dictionary
my_dict = Dictionary(redis, "test-dict")
my_dict.test_value = "Hello World"
my_dict.numbers = [10, 20, 30]
my_dict.ages = {
"User 1": 10,
"User 2": 20,
"User 3": 30,
}
# Change a user age
my_dict.ages["User 3"] = 40
# Show the variable types
print(type(my_dict.ages), type(my_dict.numbers))
# Show the entire dictionary
print(my_dict)
Starting a test server locally
To run a test server, you can use the following command to run a Redis server locally:
docker run --rm -it -p 6379:6379 redis/redis-stack-server
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
rednest-0.7.0.tar.gz
(13.6 kB
view details)
Built Distribution
rednest-0.7.0-py3-none-any.whl
(10.5 kB
view details)
File details
Details for the file rednest-0.7.0.tar.gz
.
File metadata
- Download URL: rednest-0.7.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff75be467bcfd096d2ea9f234fc6f59203afcf1bc93d2322ec6d782bbfbe6946 |
|
MD5 | 949f19532d8bcda9f766d04f500c48d8 |
|
BLAKE2b-256 | 2fe87bff458e6356a7f5dbbfdded574cf04dd345d65f57cb242830b936956b9c |
File details
Details for the file rednest-0.7.0-py3-none-any.whl
.
File metadata
- Download URL: rednest-0.7.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c7d55fec37a93fcf0dbd8b300a8ebcd5bf419cad1b90ec7b6c876afe76884df |
|
MD5 | 327fdaaa90195aa68cd5bd03c6c945c1 |
|
BLAKE2b-256 | d245926f7eb8651e4405f63e8dde8fa30b09093b68d5a00d2aad6ff8a42501b5 |