微信开放接口封装库
Project description
Mo-Cache
a simple cache lib support memory、file、redis
Github: https://github.com/mouday/mo-cache
install
pip install mo-cache
demo
from mo_cache import MemoryCache
cache = MemoryCache()
@cache
def foo(a, b):
return a + b
if __name__ == '__main__':
foo()
继承体系
from abc import ABC
class CacheAbstract(ABC):
"""统一的接口"""
def set(self, key, value, expire=-1):
pass
def get(self, key):
pass
class CacheDecorator(CacheAbstract):
"""cache 装饰器"""
class MemoryCache(CacheDecorator):
"""内存缓存"""
class FileCache(CacheDecorator):
"""文件缓存"""
class RedisCache(CacheDecorator):
"""Redis 缓存"""
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
weixin-open-api-0.0.3.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for weixin_open_api-0.0.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15f5e433481831c02de3d1b616fa8c3778cf4a4df7cffd24ddce15091edfcfd2 |
|
MD5 | a9a28faa66aa6995e153e205cf728da5 |
|
BLAKE2b-256 | 13ac33ed672c3316d84dffb122a23be469155cd9b1bc3a3db71a301039a684fc |