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.1.tar.gz
(6.5 kB
view details)
Built Distribution
File details
Details for the file cachecore-0.2.1.tar.gz
.
File metadata
- Download URL: cachecore-0.2.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d3590d176d68cd6b89133b1081b23a7d425c86e673adeb04be60050fc7c6395 |
|
MD5 | 7562bbc663a2e7159680c7b0f36ca705 |
|
BLAKE2b-256 | ef6e3662e201611b05a86cc5566d60542ade26c719e746a447e524ce3f041a6e |
File details
Details for the file cachecore-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: cachecore-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14f4bb47a38de02fe8d7dc59c984b1d4cafef7f7518cd4caf63a36c600ec2f26 |
|
MD5 | 7308f6d8e48038f584dbe34c46042232 |
|
BLAKE2b-256 | 56b95432630b56408ed881363c26263afb13263abc032ceefd99d8e789308471 |