Redis integration for the Pico ecosystem: shared client, distributed cache backend for pico-caching.
Project description
pico-data-redis
Redis for the pico ecosystem: a shared injectable client, and a distributed backend that makes @cacheable (pico-caching) work across processes. Installing it is opting in.
Installation
pip install pico-data-redis
Quick start
redis:
url: redis://cache.internal:6379/0
Inject the shared client anywhere:
from redis import Redis
from pico_ioc import component
@component
class Sessions:
def __init__(self, redis: Redis):
self._redis = redis
With pico-caching installed, @cacheable methods automatically use Redis instead of process memory — no code changes, the interceptor prefers any non-in-memory backend:
from pico_caching import cacheable
@component
class Reports:
@cacheable(ttl_seconds=300)
def heavy_query(self, day: str) -> dict: ...
Notes:
- Cached values are pickled — treat the Redis instance as trusted, private infrastructure.
- The backend fails open: an unreachable Redis degrades to cache misses, never to errors.
- Keys are namespaced under
redis.cache_prefix(defaultpico:cache:);clear()only touches that namespace. - The client's pool closes on container shutdown.
Documentation
Full documentation: https://dperezcabrera.github.io/pico-data-redis/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pico_data_redis-0.1.0.tar.gz.
File metadata
- Download URL: pico_data_redis-0.1.0.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b89c1126cddabc8c84a7ab34835481af7eb769313d63b0c713b9fbe3a817b167
|
|
| MD5 |
af40f27a149ff1caee888aa64ba5065f
|
|
| BLAKE2b-256 |
711fff8c00dd37bc113dc8fea72caae94034dda70978090aae8c5fc877a04258
|
Provenance
The following attestation bundles were made for pico_data_redis-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on dperezcabrera/pico-data-redis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pico_data_redis-0.1.0.tar.gz -
Subject digest:
b89c1126cddabc8c84a7ab34835481af7eb769313d63b0c713b9fbe3a817b167 - Sigstore transparency entry: 2137628258
- Sigstore integration time:
-
Permalink:
dperezcabrera/pico-data-redis@6a3906583b1f3dba739cec7a88ffe5de8dc03bbe -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dperezcabrera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@6a3906583b1f3dba739cec7a88ffe5de8dc03bbe -
Trigger Event:
release
-
Statement type:
File details
Details for the file pico_data_redis-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pico_data_redis-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5bd7e0bb8ec41faea64a870bec8ee407cbe9758bad0353bc290bfa998f657ad
|
|
| MD5 |
b3a21d4eb7875a6a63ed679232975a17
|
|
| BLAKE2b-256 |
d6cc7b7060321f424500dd1518caf3bf3fa23aa5360a19d71170b42606ea882d
|
Provenance
The following attestation bundles were made for pico_data_redis-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on dperezcabrera/pico-data-redis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pico_data_redis-0.1.0-py3-none-any.whl -
Subject digest:
e5bd7e0bb8ec41faea64a870bec8ee407cbe9758bad0353bc290bfa998f657ad - Sigstore transparency entry: 2137628317
- Sigstore integration time:
-
Permalink:
dperezcabrera/pico-data-redis@6a3906583b1f3dba739cec7a88ffe5de8dc03bbe -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dperezcabrera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@6a3906583b1f3dba739cec7a88ffe5de8dc03bbe -
Trigger Event:
release
-
Statement type: