evoid-redis
Redis cache engine for EVOID — Intent Handler system
Quick Start • Intent Handler • Config • API
Quick Start
uv add 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.3redis[hiredis]>=5.0.0
Optional
evoid-di>=0.1.0— for DI integration (auto-registered whenregister_handlers()is called)
DI Integration
When you call register_handlers(), Redis is auto-registered as cache.redis in evoid-di:
from evoid_di import di
# After register_handlers(), this works:
cache = di.resolve("cache.redis")
# Or as a fallback for storage:
di.set_fallback("storage.postgresql", ["cache.redis"])
Links
License
MIT
Metadata
Release files for evoid-redis 0.2.0
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 | Actions Reset |
|---|---|---|---|---|
| evoid_redis-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for evoid_redis-0.2.0-py3-none-any.whl |
Release files / evoid_redis-0.2.0-py3-none-any.whl
| Download URL | evoid_redis-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b77bfb9944383ddeba6fbb95a1e30037e67169aeee57025c949656aaa585ef9e
|
|
BLAKE2b-256 checksum How to use checksums |
9a01704003f377f0f3a692df9b35ffd5d071c49cc3921521de2cd8695c11efe2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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}
|
Security for evoid-redis 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.