Service caching API
Project description
slycache
A caching API for python loosely modeled after the Java Caching API (JSR107).
- Documentation: https://snopoke.github.io/slycache/.
Basic Usage
Start by registering a cache backend:
slycache.register_backend("default", my_cache_backend)
Define a key namespace:
# define a key namespace
user_cache = slycache.with_defaults(namespace="user")
Use the cache on methods and functions:
@user_cache.cache_result("{username}")
def get_user_by_username(username):
...
@user_cache.cache_result("{user_id}")
def get_user_by_id(user_id):
...
@user_cache.cache_put([
"{user.username}", "{user.user_id}"
])
def save_user(user):
...
@user_cache.cache_remove([
"{user.username}", "{user.user_id}"
])
def delete_user(user):
...
For more advanced usage see the documentation: https://snopoke.github.io/slycache/
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
slycache-0.3.1.tar.gz
(53.8 kB
view details)
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
slycache-0.3.1-py3-none-any.whl
(14.4 kB
view details)
File details
Details for the file slycache-0.3.1.tar.gz.
File metadata
- Download URL: slycache-0.3.1.tar.gz
- Upload date:
- Size: 53.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3ddc6bc0179b54b74ec13f0676c465f3d639278d37e3906f8606b11e5384104
|
|
| MD5 |
0aa57a45e59bf6e647b65f0106690a69
|
|
| BLAKE2b-256 |
f926531619f7551faace5257ab63b6d2a2ebc0b6cc6c5b7b7903abc09ef6f5e2
|
File details
Details for the file slycache-0.3.1-py3-none-any.whl.
File metadata
- Download URL: slycache-0.3.1-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4175363f1640e46636026753884d539304b17f7d5bf0b7e3620156a5d442e3c9
|
|
| MD5 |
0314e39a3af80dbe5954e42923a6e115
|
|
| BLAKE2b-256 |
8027cf2a5d1aaeb81ec984ae492b44d8f5b82ca2361d3b1dc89a566d561d29a3
|