Class and decorator to use with Redis
Project description
Redis Decorator Generator
Description
This package is a simple wrapper around the standard redis.Redis package pip install redis.
The 'generate' function is meant to help speed up the integration process.
Examples
Example 1
Use the generator directly on a function.
@generate(redis_url="redis://:foobared@localhost:6379/0")(ttl=60)
def my_func(*args: Any, **kwargs: Any) -> Any:
sarg = ":".join([str(arg) for arg in args])
skwarg = ":".join([f"{key}={str(value)}" for key, value in kwargs.items()])
return sarg + "::" + skwarg
Example 2
Generate the decorator so that it can be imported.
cache = generate(redis_url="redis://:foobared@localhost:6379/0")
@cache(ttl=60)
def my_func(*args: Any, **kwargs: Any) -> Any:
sarg = ":".join([str(arg) for arg in args])
skwarg = ":".join([f"{key}={str(value)}" for key, value in kwargs.items()])
return sarg + "::" + skwarg
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 redis_decorator_generator-0.0.3.tar.gz.
File metadata
- Download URL: redis_decorator_generator-0.0.3.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b992560eca4916c8a3c8fa096b5de1b02c666f61dafda14f59e57ff435ecb759
|
|
| MD5 |
8002c572ad74d41a52383822a9b0102b
|
|
| BLAKE2b-256 |
b778f1843a422a871c29c94569fcf9dc19e8f023388df2f6b7b35a3b30f6415a
|
Provenance
The following attestation bundles were made for redis_decorator_generator-0.0.3.tar.gz:
Publisher:
deploy.yaml on bkmetzler/redis-decorator-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_decorator_generator-0.0.3.tar.gz -
Subject digest:
b992560eca4916c8a3c8fa096b5de1b02c666f61dafda14f59e57ff435ecb759 - Sigstore transparency entry: 653360187
- Sigstore integration time:
-
Permalink:
bkmetzler/redis-decorator-generator@9224864935955d16fd5df58eb9926adef99b1c4b -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/bkmetzler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yaml@9224864935955d16fd5df58eb9926adef99b1c4b -
Trigger Event:
release
-
Statement type:
File details
Details for the file redis_decorator_generator-0.0.3-py3-none-any.whl.
File metadata
- Download URL: redis_decorator_generator-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd4563b5a5e6afff792bebc6b0d5eee7557934843eaa710730a56b992b748e38
|
|
| MD5 |
e53c00924bbd849966e05cd0d939ae58
|
|
| BLAKE2b-256 |
e79c425305a10f55992fe4d32c824c9b56e512bc44b0ebf45b4df1301914bccd
|
Provenance
The following attestation bundles were made for redis_decorator_generator-0.0.3-py3-none-any.whl:
Publisher:
deploy.yaml on bkmetzler/redis-decorator-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_decorator_generator-0.0.3-py3-none-any.whl -
Subject digest:
fd4563b5a5e6afff792bebc6b0d5eee7557934843eaa710730a56b992b748e38 - Sigstore transparency entry: 653360188
- Sigstore integration time:
-
Permalink:
bkmetzler/redis-decorator-generator@9224864935955d16fd5df58eb9926adef99b1c4b -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/bkmetzler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yaml@9224864935955d16fd5df58eb9926adef99b1c4b -
Trigger Event:
release
-
Statement type: