cacheing - Pure Python Cacheing Library
Motivation
The initial motivation behind this package was twofold: fix the long insertion/eviction times in cachetools.LFUCache and provide an alternative to the cachetools.TTLCache offering variable per-key TTL's.
Installation
pip install -U cacheing
And then in your python interpreter:
import cacheing
Updating
Usage
>>> from cacheing import LFUCache
>>> cache = LFUCache(capacity=2)
>>> cache[1] = 2
>>> cache[2] = 3
>>> cache[3] = 4
>>> cache
LFUCache{2: 3, 3: 4}
Benchmark
cacheing has an included benchmarking library found in ./benchmark.
$ python3 ./benchmark.py --help
usage: benchmark [-h] [--cache [CACHE [CACHE ...]]] [--method [{get,set,delete} [{get,set,delete} ...]]]
arguments:
-h, --help show this help message and exit
--cache [CACHE [CACHE ...]], -c [CACHE [CACHE ...]]
cache(s) to benchmark. example: cacheing.LRUCache.
--method [{get,set,delete} [{get,set,delete} ...]], -m [{get,set,delete} [{get,set,delete} ...]]
method(s) to benchmark.
Run the Benchmarks:
$ cd benchmark
$ python3 ./benchmark.py --cache cachetools.LRUCache cacheing.LRUCache --method set get delete
Performance
All benchmark times were measured using the provided benchmark library. See the
benchmark section for details. The default benchmarking configuration executes 100,000 get operations,
20,000 set operations and n = cache_size delete operations. The median, p90, and p99 times for each
operation, measured in microseconds, or 1e-6, are displayed in the figures below.
Get (LFU Cache) Delete (LFU Cache)
Set (LFU Cache) Set - Cross Section (LFU Cache)
Set (LRU Cache) Get (LRU Cache)
Delete (LRU Cache)
Metadata
Release files for cacheing 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cacheing-0.1.1.tar.gz | 11.3 kB | Without provenance | Details for cacheing-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cacheing-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for cacheing-0.1.1-py3-none-any.whl |
Total release size: 21.7 kB
Release files / cacheing-0.1.1.tar.gz
| Download URL | cacheing-0.1.1.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb83d67c5d7af5364f1a338da2c5cf26b4623c5f5670bd2a61ee93123d1b00c2
|
|
BLAKE2b-256 checksum How to use checksums |
1e5a3dcf8f1a3b6fcbdebcb3f3b94082973ec0384d40bfcd3d59dcec17991dca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.3 Windows/10
|
Release files / cacheing-0.1.1-py3-none-any.whl
| Download URL | cacheing-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3719f9d5c2a846ed2839d65a76c4bd5bd4c440fa37d92af998545a7fa571ee3f
|
|
BLAKE2b-256 checksum How to use checksums |
d2c8c8d8668700b51dd99dfda012f3ba0fd013ff685f8a6665ecff3b61f12fe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.3 Windows/10
|
Security for cacheing 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.