A lightweight in-memory cache inspired by Redis (educational)
Project description
Rapid Redis
Rapid Redis is a lightweight, educational in-memory cache library inspired by Redis. It is built entirely in Python for learning purposes and designed to be simple, minimal, and easy to extend.
Overview
Rapid Redis provides a basic Redis-like interface for storing and managing cached data using Python dictionaries under the hood. It currently supports five common data structures and exposes simple, intuitive methods for cache operations.
Features
-
In-memory key-value cache using Python dictionaries
-
Basic operations:
set,get,delete,exists, andflush -
Supports multiple data structures:
- Strings
- Lists
- Sets
- Hashes
- Sorted Sets
-
Easy to use and lightweight — ideal for understanding Redis fundamentals
Installation
You can install Rapid Redis locally using:
pip install -e .
(Ensure you run this from the project root directory where setup.py is located.)
Usage
from rapid_redis import RapidCache
from rapid_redis.datastructures import strings, lists, sets, hashes, sortedsets
cache = RapidCache()
# String operations
cache.set("name", "Atharsh")
print(cache.get("name")) # Output: Atharsh
# List operations
lists.lpush(cache, "mylist", 1, 2, 3)
print(cache.get("mylist")) # Output: [3, 2, 1]
# Set operations
sets.sadd(cache, "myset", "a", "b", "c")
print(sets.smembers(cache, "myset")) # Output: {'a', 'b', 'c'}
# Hash operations
hashes.hset(cache, "user:1", "name", "Atharsh")
print(hashes.hget(cache, "user:1", "name")) # Output: Atharsh
# Sorted set operations
sortedsets.zadd(cache, "scores", 10, "Alice")
sortedsets.zadd(cache, "scores", 5, "Bob")
print(sortedsets.zrange(cache, "scores", 0, -1)) # Output: ['Bob', 'Alice']
Roadmap
Planned features for upcoming releases include:
- TTL (Time-to-Live) support for expiring keys
- Persistent cache storage (saving data to disk)
- Thread-safe operations
- Command-line interface for quick cache access
- Optional lightweight server mode for experimentation
- Concurrency for multiple user handling
Contributing
Rapid Redis is an open project — contributions are welcome. If you’d like to improve functionality, add features, or clean up code, feel free to fork the repository and open a pull request.
License
This project is released under the MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rapid_redis-0.1.0.tar.gz.
File metadata
- Download URL: rapid_redis-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6c476c755ca2d5e871e5b910e031a314026d87814f60f08c2d6094a6a01ee1e
|
|
| MD5 |
798744abfacbc07628b9e2fed869cf2b
|
|
| BLAKE2b-256 |
14fe9a8c2c10a3875b8ac8ee9eda80265aa1f3c6a60762da0c6e13fa3a8499ee
|
File details
Details for the file rapid_redis-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rapid_redis-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c535b391430d2457a447a10e9d132998c1507ffc963f2b88b3accb8a52cfd98c
|
|
| MD5 |
2e63f0bd41df51a00e5361ebf4941c20
|
|
| BLAKE2b-256 |
123fd86201fbb2de7f502c8e91201a85d342906c4a5c280b2b3b926f620d5ec8
|