Simple cache manager
Project description
Cache manager
Простой кеш - хранение в файлах:
from cache_manager.pickle import PickleCache
from datetime import timedelta
cache_manager = PickleCache('./cache')
@cache_manager(ttl=timedelta(hours=1))
def some_function():
pass
Memcached:
from cache_manager.memcached import MemcachedCache
from datetime import timedelta
cache_manager = MemcachedCache(('10.5.0.11', 11211)) # в случае соединения по TCP или UDP сокету
cache_manager = MemcachedCache('/usr/run/memcached.sock') # в случае соединия по unix сокету
@cache_manager(ttl=timedelta(hours=1))
def some_function():
pass
Redis:
from cache_manager.redis import RedisCache
from datetime import timedelta
cache_manager = RedisCache(('10.5.0.11', 6379), password='somepassword') # в случае соединения по TCP или UDP сокету
cache_manager = RedisCache('/usr/run/redis.sock', password='somepassword') # в случае соединия по unix сокету
@cache_manager(ttl=timedelta(hours=1))
def some_function():
pass
Etcd:
from cache_manager.etcd import EtcdCache
from datetime import timedelta
cache_manager = EtcdCache(('10.5.0.11', 2371), scheme='http')
@cache_manager(ttl=timedelta(hours=1))
def some_function():
pass
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 Distribution
cache_manager-0.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for cache_manager-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 496fd7d4c971c18614604aadf46cf95fd5538a57b31f878a64c79fea8c38eb1d |
|
MD5 | ecfac35205063d6f854bcd469d019b54 |
|
BLAKE2b-256 | 9165b3aa785540ad071f212ff3a5ec93809b2e408884463639eab5256cfcf3f6 |