detool-1.0.7
توضیحات
decorator tool collection
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | detool-1.0.7 |
| نام | detool |
| نسخه کتابخانه | 1.0.7 |
| نگهدارنده | ['cc'] |
| ایمیل نگهدارنده | ['abcdef123456chen@sohu.com'] |
| نویسنده | abo123456789 |
| ایمیل نویسنده | abcdef123456chen@sohu.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/detool/ |
| مجوز | MIT License |
[](https://pypi.org/project/leek)
### 常用装饰器工具集
#### pip安装
```shell
pip install detool
```
#### 1.统计函数执行时长装饰器
```python
import time
from detool import timer_cost
@timer_cost
def t_time():
time.sleep(0.01)
print(123)
```
#### 2.redis缓存装饰器
```python
from detool import RedisCache
redis_cache = RedisCache(host='127.0.0.1', password='', port=6379, db=0)
@redis_cache.cache(ttl=30)
def sum_t(a, b):
print(f'{a}+{b}={a + b}')
return a + b
r = sum_t(1, 2)
print(r)
```
نیازمندی
| مقدار | نام |
|---|---|
| >=0.6.0 | loguru |
| >=3.0.0 | redis |
نحوه نصب
نصب پکیج whl detool-1.0.7:
pip install detool-1.0.7.whl
نصب پکیج tar.gz detool-1.0.7:
pip install detool-1.0.7.tar.gz