微信开放接口封装库
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.4.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for weixin_open_api-0.0.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dd1ba0f06a65badba3bb8aaccbe98b41c966af4d8ec9cb604bf49365d48ad8f |
|
MD5 | 57e5105df53b613e61827fed919db0e0 |
|
BLAKE2b-256 | 1ae2dd6cfe0454ec0cf5a899a9b877bafa7d377750b04b493fc22ae30a7741e6 |