evoid-redis
Redis cache engine for EVOID — Intent Handler system
Quick Start • Intent Handler • Config • API
Quick Start
pip install evoid-redis
Method 1: Intent Handler (Recommended)
from evoid_redis import register_handlers
from evoid.core.cache import cache_get, cache_set, cache_delete
# Register Redis as cache handler
register_handlers(url="redis://localhost:6379", prefix="myapp:")
# Use high-level API — goes through Intent pipeline
await cache_set("session:abc", {"user": "Alice"}, ttl=300)
data = await cache_get("session:abc")
await cache_delete("session:abc")
Method 2: Direct API
from evoid_redis import create_cache
cache = create_cache("redis://localhost:6379", prefix="myapp:")
await cache.set("key", {"data": "value"}, ttl=300)
data = await cache.get("key")
Intent Handler
evoid-redis registers these Intent handlers:
| Intent | Handler | Description |
|---|---|---|
cache.get |
handle_get |
Get value from Redis |
cache.set |
handle_set |
Set value with optional TTL |
cache.delete |
handle_delete |
Delete key |
cache.exists |
handle_exists |
Check key existence |
cache.health |
handle_health |
Ping Redis server |
How it works
register_handlers()registers Intent handlers for cache operationscache_get()/cache_set()create Intents and execute through pipeline- Pipeline routes to Redis handler
- Handler connects to Redis and performs operation
Configuration
TOML
[engines]
cache = "redis"
[engines.options.redis]
url = "redis://localhost:6379"
prefix = "myapp:"
Python
from evoid.config import config
app = config(
engines={
"cache": "redis",
"options": {
"redis": {
"url": "redis://prod:6379",
"prefix": "production:",
},
},
},
)
API
register_handlers(url, prefix)
Register Redis as Intent handlers.
| Parameter | Type | Default | Description |
|---|---|---|---|
url |
str |
redis://localhost:6379 |
Redis connection URL |
prefix |
str |
evoid: |
Key prefix |
create_cache(url, prefix) -> RedisCache
Factory function for direct API access.
Methods
| Method | Signature | Returns | Description |
|---|---|---|---|
get |
async get(key: str) |
Any | None |
Get value (auto JSON decode) |
set |
async set(key: str, value: Any, ttl: int | None) |
bool |
Set value with optional TTL |
delete |
async delete(key: str) |
bool |
Delete key |
exists |
async exists(key: str) |
bool |
Check key exists |
health |
async health() |
bool |
Ping Redis |
Dependencies
evoid>=0.4.0redis[hiredis]>=5.0.0
Links
License
MIT
Release files for evoid-redis 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| evoid_redis-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / evoid_redis-0.1.1-py3-none-any.whl
| Download URL | evoid_redis-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9aa198de6b6cf5fbc8826a8e8b4bf957812b8418668d2f6975eab94385ce3a0b
|
|
BLAKE2b-256 checksum How to use checksums |
d808c87d1c2cedee4305126bae62cbc090dc838f0d6604f97c63f6191fb206c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|