No project description provided
Project description
# red_cache
#### 介绍
基于Redis实现的Python缓存工具
#### 示例
##### 安装方法
```shell
$ pip install red-cache==0.0.3
```
##### 缓存函数执行结果
```python
@redis_cache.pickle_cache(key=lambda v, t: "cache:{}:{}".format(v, t), ex=180)
def hell_world(val: str, times: int):
return val * times
```
##### 保存JSON缓存数据
```python
@redis_cache.json_cache(key=lambda v, t: "cache:{}:{}".format(v, t), ex=180)
def hell_world(val: str, times: int):
return {"val": val, "times": times}
```
##### 缓存的属性
```python
class Demo:
def load_xxx(self):
return
xxx = redis_cache.property(key=lambda: "Demo::xxx", ex=10)(lambda self: self.load_xxx())
```
@author:[Memory_Leak](http://vvia.xyz/wjLSh5)
#### 介绍
基于Redis实现的Python缓存工具
#### 示例
##### 安装方法
```shell
$ pip install red-cache==0.0.3
```
##### 缓存函数执行结果
```python
@redis_cache.pickle_cache(key=lambda v, t: "cache:{}:{}".format(v, t), ex=180)
def hell_world(val: str, times: int):
return val * times
```
##### 保存JSON缓存数据
```python
@redis_cache.json_cache(key=lambda v, t: "cache:{}:{}".format(v, t), ex=180)
def hell_world(val: str, times: int):
return {"val": val, "times": times}
```
##### 缓存的属性
```python
class Demo:
def load_xxx(self):
return
xxx = redis_cache.property(key=lambda: "Demo::xxx", ex=10)(lambda self: self.load_xxx())
```
@author:[Memory_Leak](http://vvia.xyz/wjLSh5)
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for red_cache-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b94460b43c20f58e22774e9538d9377d80071bdc771c577db05dd5189eb844d1 |
|
MD5 | b47f27406963969c3e72bcbec61197a5 |
|
BLAKE2b-256 | b6ae107b42b118dacdd47c847665f49ff5d239e4f739930a6e5cef6749c1bde1 |