Skip to main content

Redis object nesting using ReJSON

Project description

RedNest

Redis dictionary / array nesting using ReJSON.

Usage example

import redis

from rednest import Dictionary, Array

# Initialize redis connection
redis = redis.Redis(...)

# Create your dictionary
my_dict = Dictionary("test-dict", redis)
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


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.3.1.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

rednest-0.3.1-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page