Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini-Redis

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-cli

Direct 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, port 6039.
  • The client API is available via mini_redis.cli.MiniRedisClient for 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"))

About

A minimal Redis-like in-memory key-value store implemented with Python sockets and threads.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages