Skip to main content

(Redis Imaginary Nesting) brings poetic structure to Redis with elegant, nestable clusters—turning your keyspace into a meaningful, typed, and navigable hierarchy.

Project description

RediSimNest

A sophisticated, prefix-based Redis key management system with customizable clusters, dynamic key types, and parameterized prefix resolution. Ideal for organizing application state and simplifying Redis interactions in complex systems.

Table of Contents

  • Installation
  • Usage
  • Features
  • Configuration
  • Contributing
  • License
  • Acknowledgments

Installation

You can install RediSimNest via pip:

pip install redisimnest

Alternatively, install from source:

git clone https://github.com/yourusername/redisimnest.git
cd redisimnest
pip install .

Usage

Here's a basic example of how to use RediSimNest in your project:

from redisimnest import Key, BaseCluster

# Define a cluster with a parameterized prefix
class MyCluster(BaseCluster):
    __prefix__ = "user:{user_id}:data"

cluster = MyCluster(user_id=123)
print(cluster.get_full_prefix())  # Output: user:123:data

Check out the full documentation for more advanced use cases and examples.

Features

  • Prefix-Based Cluster Management: Organize Redis keys with flexible, dynamic prefixes.
  • Support for Parameterized Keys: Create keys with placeholders that can be dynamically replaced.
  • TTL Management: Automatic and manual control over key TTLs.
  • Cluster Hierarchies: Nested clusters with inherited parameters.
  • Typed Key Classes: Use Python types to define and validate Redis key value structures.
  • Auto-Binding & Dynamic Access: Smart access to nested clusters and runtime bindings.
  • Command Dispatching: Type-aware command routing with serialization/deserialization support.

Configuration

RediSimNest allows you to customize the following settings:

  • REDIS_HOST: Redis server hostname (default: localhost).
  • REDIS_PORT: Redis server port (default: 6379).
  • REDIS_USERNAME / REDIS_PASS: Optional authentication credentials.
  • REDIS_DELETE_CHUNK_SIZE: Number of items deleted per operation (default: 50).

You can set these via environment variables or within your settings.py:

import os

REDIS_HOST = os.getenv("REDIS_HOST", "localhost")
REDIS_PORT = int(os.getenv("REDIS_PORT", "6379"))
REDIS_DELETE_CHUNK_SIZE = 50

Contributing

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Write tests for your changes.
  5. Submit a pull request.

Please ensure all tests pass before submitting your PR.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to redis-py for the Redis client.
  • Inspired by Django's settings and configuration systems.

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

redisimnest-0.1.0.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redisimnest-0.1.0-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file redisimnest-0.1.0.tar.gz.

File metadata

  • Download URL: redisimnest-0.1.0.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for redisimnest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c111a084f7936d922a0c9717fb741549548c0f4ce80db162886e2481f5498098
MD5 8c1bbb0703ecabbe2dce481a4d0665aa
BLAKE2b-256 bd8afe1b3cd9b6b6044253d466a3c4d01c65bab128a4e2829fe84623e200de24

See more details on using hashes here.

File details

Details for the file redisimnest-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: redisimnest-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for redisimnest-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4348ad19fe03ff5ef8287cdee0357351154757f6da23784db6a151189bc83a3
MD5 7c1f23fae3c67d0464123a955dcb54d0
BLAKE2b-256 6886cac451c97699676f378a1ac55b68a613fee580388149e919bca7aa04e426

See more details on using hashes here.

Supported by

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