1 Commits
Author SHA1 Message Date
dsql 7aed6853ed release: 1.0.0
first stable release. pre-1.0.0 verification complete: all surviving MED regressions and
gaps resolved and independently re-fired, tree audited clean across the suite.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-06 21:21:00 -04:00
3 changed files with 21 additions and 23 deletions
+3 -3
View File
@@ -14,19 +14,19 @@ datastore trio (`redis` / `psql` / `mysql`), a sibling of the `mongo` lib.
`requirements.txt`:
```
redis_store @ git+ssh://git@git.rethinkstudios.io/rethink-public/redis.git@v1.0.0
redis_store @ git+ssh://git@git.rethinkstudios.io/rethink-public/redis.git@v0.2.1
```
Direct:
```bash
pip install "redis_store @ git+ssh://git@git.rethinkstudios.io/rethink-public/redis.git@v1.0.0"
pip install "redis_store @ git+ssh://git@git.rethinkstudios.io/rethink-public/redis.git@v0.2.1"
```
Pulls `redis>=5.0.1` (redis-py, which ships the asyncio client — **not** the dead standalone
`aioredis`; `5.0.1` is the floor because `5.0.0` lacks the async client's `aclose()`).
Drop the `@v1.0.0` suffix from the line above to install the latest unpinned.
Drop the `@v0.2.1` suffix from the line above to install the latest unpinned.
## Usage
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "redis_store"
version = "1.1.0"
version = "1.0.0"
description = "async redis wrapper over redis-py asyncio with a raw escape hatch, fail-loud and config-free"
requires-python = ">=3.10"
dependencies = [
+17 -19
View File
@@ -12,11 +12,9 @@ context manager:
async with RedisDB(host="localhost") as kv:
await kv.incr("hits")
fail loud: wrapped methods catch RedisError and re-raise it - the raised exception IS
the signal, and the caller (which alone knows fatal-vs-routine) decides and logs; the
wrapped method logs only at DEBUG (with the traceback) so a failure isn't reported
twice (raise XOR log). see each method's docstring for its own contract. unwrapped ops
go through the raw `.client` escape hatch: full driver surface, raises.
fail loud: wrapped methods catch RedisError, log, and re-raise; see each method's
docstring for its own contract. unwrapped ops go through the raw `.client` escape
hatch: full driver surface, raises.
notes:
- import is `redis_store`; repo is `redis`, distribution is `redis_store` (the
@@ -89,7 +87,7 @@ class RedisDB:
try:
await self._client.ping()
except RedisError:
log.debug("redis.connect() ping failed", exc_info=True)
log.exception("redis.connect() ping failed")
await self._pool.disconnect()
raise
return self
@@ -106,7 +104,7 @@ class RedisDB:
finally:
await self._pool.disconnect()
except RedisError:
log.debug("redis.close()", exc_info=True)
log.exception("redis.close()")
raise
async def __aenter__(self) -> "RedisDB":
@@ -130,7 +128,7 @@ class RedisDB:
try:
return await self._client.get(key)
except RedisError:
log.debug("redis.get(%s)", key, exc_info=True)
log.exception("redis.get(%s)", key)
raise
async def set(self, key: str, value, ex: Optional[int] = None) -> bool:
@@ -138,7 +136,7 @@ class RedisDB:
try:
return bool(await self._client.set(key, value, ex=ex))
except RedisError:
log.debug("redis.set(%s)", key, exc_info=True)
log.exception("redis.set(%s)", key)
raise
async def delete(self, *keys: str) -> int:
@@ -146,7 +144,7 @@ class RedisDB:
try:
return await self._client.delete(*keys)
except RedisError:
log.debug("redis.delete(%s)", keys, exc_info=True)
log.exception("redis.delete(%s)", keys)
raise
async def exists(self, *keys: str) -> int:
@@ -154,7 +152,7 @@ class RedisDB:
try:
return await self._client.exists(*keys)
except RedisError:
log.debug("redis.exists(%s)", keys, exc_info=True)
log.exception("redis.exists(%s)", keys)
raise
async def incr(self, key: str, amount: int = 1) -> int:
@@ -162,7 +160,7 @@ class RedisDB:
try:
return await self._client.incrby(key, amount)
except RedisError:
log.debug("redis.incr(%s)", key, exc_info=True)
log.exception("redis.incr(%s)", key)
raise
async def decr(self, key: str, amount: int = 1) -> int:
@@ -170,7 +168,7 @@ class RedisDB:
try:
return await self._client.decrby(key, amount)
except RedisError:
log.debug("redis.decr(%s)", key, exc_info=True)
log.exception("redis.decr(%s)", key)
raise
async def hget(self, name: str, field: str) -> Optional[str]:
@@ -178,7 +176,7 @@ class RedisDB:
try:
return await self._client.hget(name, field)
except RedisError:
log.debug("redis.hget(%s, %s)", name, field, exc_info=True)
log.exception("redis.hget(%s, %s)", name, field)
raise
async def hset(self, name: str, key: Optional[str] = None, value=None, mapping: Optional[dict] = None) -> int:
@@ -189,7 +187,7 @@ class RedisDB:
try:
return await self._client.hset(name, key=key, value=value, mapping=mapping)
except RedisError:
log.debug("redis.hset(%s)", name, exc_info=True)
log.exception("redis.hset(%s)", name)
raise
async def hgetall(self, name: str) -> dict:
@@ -197,7 +195,7 @@ class RedisDB:
try:
return await self._client.hgetall(name)
except RedisError:
log.debug("redis.hgetall(%s)", name, exc_info=True)
log.exception("redis.hgetall(%s)", name)
raise
async def hdel(self, name: str, *fields: str) -> int:
@@ -205,7 +203,7 @@ class RedisDB:
try:
return await self._client.hdel(name, *fields)
except RedisError:
log.debug("redis.hdel(%s)", name, exc_info=True)
log.exception("redis.hdel(%s)", name)
raise
async def expire(self, key: str, seconds: int) -> bool:
@@ -213,7 +211,7 @@ class RedisDB:
try:
return bool(await self._client.expire(key, seconds))
except RedisError:
log.debug("redis.expire(%s)", key, exc_info=True)
log.exception("redis.expire(%s)", key)
raise
async def ttl(self, key: str) -> int:
@@ -225,5 +223,5 @@ class RedisDB:
try:
return await self._client.ttl(key)
except RedisError:
log.debug("redis.ttl(%s)", key, exc_info=True)
log.exception("redis.ttl(%s)", key)
raise