A minimal Redis-like in-memory key-value store implemented with Python sockets and threads.
Requirements
- Python >= 3.12
Install (editable)
pip install -e .Quick start
- Start the server (defaults to localhost:6039):
mini-redis- Start the interactive client (connects to localhost:6039):
mini-redis-cliDirect usage (after install)
- SET a key:
SET mykey {"name":"alice"} - GET a key:
GET mykey - Delete a key:
DEL mykey
Notes
- Package exposes entry points:
mini-redis->mini_redis.server:main,mini-redis-cli->mini_redis.cli:main. - Defaults: host
localhost, port6039. - The client API is available via
mini_redis.cli.MiniRedisClientfor programmatic use.
That's it — small, single-file server and client for experimentation.
Example interactive session
# start server
mini-redis
# in another shell start client
mini-redis-cli
localhost:6039> SET mykey {"name":"alice"}
1
localhost:6039> GET mykey
{"name":"alice"}
localhost:6039> DEL mykey
{'name': 'alice'}
localhost:6039> GET mykey
None
Programmatic example
from mini_redis import MiniRedisClient
with MiniRedisClient() as client:
print(client.set("greeting", '{"name":"Ogenna"}'))
print(client.get("greeting"))
print(client.delete("greeting"))