A low level cache library.
Project description
cachecore
A low-level caching library with multiple implementations.
Can be used as a stand-alone cacheing library or can be used to create higher level caching libraries.
Basics
Get, set, delete, and check for the existence of a key using the following.
>>> import cachecore
>>> cache = cachecore.LocalCache()
>>> cache.set('a', 1)
>>> cache.get('a')
1
>>> cache.has_key('a')
True
>>> cache.delete('a')
True
>>> cache.has_key('a')
False
>>> cache.get('a')
MissingKey
Complete API
- get(self, key: str) -> Union[Any, MissingKey]
- set(self, key: str, value: Any, ttl: Optional[int]=None)
- add(self, key: str, value: Any, ttl: Optional[int]=None) -> bool
- delete(self, key: str) -> bool
- has_key(self, key: str) -> bool
- get_many(self, keys: list[str]) -> list[Any]
- set_many(self, mapping: Iterable[tuple[str, Any]], ttl: Optional[int]=None)
- delete_many(self, keys: list[str]) -> list[bool]:
- get_ttl(self, key: str) -> Union[int, None, MissingKey]
- set_ttl(self, key: str, ttl: Optional[int]=None)
- incr(self, key, delta=1) -> int
- decr(self, key, delta=1) -> int
- clear(self)
Cache Implementations
- Dummy
- Local Memory
- File System
- Memcached (Coming Soon)
- 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
cachecore-0.2.0.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for cachecore-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8fcdd8b073baf8e6176c075996646c828aa8ca7e206e4d4916cb362012d1bd7 |
|
MD5 | e754e5d2fcb20467b4109380b6b793bd |
|
BLAKE2b-256 | 4567034788091837ed13c4646b5e2424fb3729c422684f5e0397c853cc2c4bd3 |