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