nyxa-cache — batteries-included cache for Nyxa
In-memory (default) and optional Redis cache for apps built with
nyxa. Core nyxa does not
depend on Redis.
At a glance
| What you need | Nyxa Cache |
|---|---|
| Read / write a key | cache.get / cache.put |
| Compute once, then cache | cache.remember / cache.remember_async |
| Remove one key / clear all | cache.forget / cache.flush |
| Shared Redis backend | CACHE_STORE=redis + CACHE_REDIS_URL / REDIS_URL |
Install
uv add nyxa-cache
# optional Redis backend:
uv add 'nyxa-cache[redis]'
Quick start
from nyxa_cache import cache
cache.put("greeting", "hello", ttl=60)
assert cache.get("greeting") == "hello"
value = cache.remember("user:1", 120, lambda: {"id": 1})
# In async services:
user = await cache.remember_async(f"user:{item_id}", 60, lambda: load_user(item_id))
Configuration
CACHE_STORE=memory # default
# CACHE_STORE=redis
# CACHE_REDIS_URL=redis://localhost:6379/0
# REDIS_URL=... # fallback when CACHE_REDIS_URL unset
CLI
uv run nyxa cache clear
Metadata
Release files for nyxa-cache 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nyxa_cache-0.1.0.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nyxa_cache-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / nyxa_cache-0.1.0.tar.gz
| Download URL | nyxa_cache-0.1.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
697ae234015b59c2db063950de53fa1e66f0279a9c480e8bf5689c875aac6cf3
|
|
BLAKE2b-256 checksum How to use checksums |
ee994729fe533ec4bbfc124acfa79368399ac89ca3181d5de36c5a2b2135eae0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","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}
|
Release files / nyxa_cache-0.1.0-py3-none-any.whl
| Download URL | nyxa_cache-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bc5a6c21d9d1c6f6e5d47da479ed7b409b6fd4787436c26c96a5e3629bf440a
|
|
BLAKE2b-256 checksum How to use checksums |
65ed5ca672a778bf213ec2f14f8633dcdd3024b66fb5d29de3c39ea13965818d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","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}
|