Pycachu
A tool to provide a LRU cache on files.
It has been created to store gigabytes of Thumbor thumbnails on a DigitalOcean server.
Usage
from pycachu import Pycachu
# Initialize the cache
# The dir has to exist
p = Pycachu('/storage/pycachu', 20 * (1024 ** 3))
# Get a file
f = p.get('/some/file')
if f is not None:
yield f
f.close()
else:
content = generate_file_content()
p.put('/some/file', content)
content.seek(0)
yield content
content.close()
Performance
The performance is not exceptional, but operations basically take a constant time independently of the number of files in the cache, which is not too bad.
Rough benchmarking gave about 170 get per second.
Metadata
Release files for pycachu 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 | |
|---|---|---|---|---|
| pycachu-0.1.1.tar.gz | 3.2 kB | Without provenance | Details |
Release files / pycachu-0.1.1.tar.gz
| Download URL | pycachu-0.1.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10c5941f555fb996cd1e8fb93fdcfcf73df45a5636f9238f4b1850db95a15ba6
|
|
BLAKE2b-256 checksum How to use checksums |
bc20a55db8d8e744344c718b534aee5226cb879b5c813dd099dab0bfc27ca1a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pycachu 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.