Metadata-Version: 2.4
Name: redis-flex
Version: 0.2.2
Summary: A smart, typed Redis client that auto-detects object types and serializes them safely.
Author-email: Nishant Garg <nishant.garg.work@gmail.com>
License-Expression: MIT
Project-URL: homepage, https://github.com/Nishant20231667/redis-flex
Project-URL: repository, https://github.com/Nishant20231667/redis-flex
Keywords: redis,cache,serialization,python,typed redis
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: redis
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: cython
Requires-Dist: pyarrow
Requires-Dist: Pillow
Requires-Dist: fastparquet
Dynamic: license-file

redis-flex

A lightweight, flexible, and developer-friendly wrapper around Redis that simplifies common cache operations while keeping your code clean, fast, and maintainable.

redis-flex provides:

🔥 Simple get/set API

🧠 Automatic JSON serialization/deserialization

⏱️ Built-in TTL support

🧩 Optional namespacing

🚀 Zero-config fast setup

📝 Type-hint friendly design

Perfect for Python backend applications, microservices, FastAPI/Django projects, or any system that needs blazing-fast caching with Redis.

📦 Installation
pip install redis-flex

🚀 Quick Start
from redis_flex import RedisFlex

# Initialize client

cache = RedisFlex(host="localhost", port=6379, db=0)

# Set a value

cache.set("user:1", {"name": "Nishant", "role": "developer"}, ttl=300)

# Get the value back (auto JSON decoded!)

user = cache.get("user:1")
print(user)

🧠 Features
✔ Simple API
cache.set("key", "value")
cache.get("key")

✔ Auto JSON support
cache.set("profile", {"name": "Nishant"})
profile = cache.get("profile") # returns dict

✔ Namespacing

Useful for multi-tenant apps:

cache_ns = RedisFlex(namespace="app1")
cache_ns.set("token", "abcd")

Internally stored as: app1:token

✔ TTL (Expiry)
cache.set("otp", 1234, ttl=60)

✔ Delete key
cache.delete("user:1")

⚙️ Initialization Options
RedisFlex(
host="localhost",
port=6379,
db=0,
password=None,
namespace=None,
decode_responses=True
)

🔧 API Reference
set(key, value, ttl=None)

Stores data in Redis. Auto-converts Python objects to JSON.

get(key)

Fetches data. Auto-deserializes JSON back to Python types.

delete(key)

Deletes the key.

📁 Project Structure
redis_flex/
**init**.py
redis_flex.py
README.md
pyproject.toml
LICENSE

🛠️ Contributing

Pull requests are welcome!
If you're making major changes, please open an issue first to discuss what you'd like to change.

📜 License

This project is licensed under the MIT License.

⭐ Support

If you find redis-flex useful, give it a star on GitHub and help others discover it!
