A Python package for caching data in the file system.
Project description
fscache
fscache is a Python package for caching data in the file system.
Installation
pip install fscache
Usage
import requests
from fscache import fscache
url = 'https://example.com/index.html'
cache_file = fscache.path(url, cache_dir='.fscache')
if fscache.valid(cache_file, lifetime=3600):
content = fscache.load(cache_file)
# Do something with content
else:
content = requests.get(url).text
# Save content in .fscache/https/example.com/index.html
fscache.save(cache_file, content)
License
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
fscache-0.4.0.tar.gz
(7.9 kB
view details)
Built Distribution
File details
Details for the file fscache-0.4.0.tar.gz
.
File metadata
- Download URL: fscache-0.4.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79a00c70c669d1f8312ed7880835a3fcbe1a97e3d78c7f46520e7f9e405ad523 |
|
MD5 | c07f72af897e1860ddbeb9b2844ea739 |
|
BLAKE2b-256 | ab7295a8267b5a010912765ec57cd42cc136d7db59c2c7b073ffd81fcbbc8c7d |
File details
Details for the file fscache-0.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: fscache-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc3eb0849142e82b9c6d0b1354b41d724e044c3dda7cdc1c21a72d43ad661067 |
|
MD5 | 4d29fe6db459c8c946d7a250aac784d8 |
|
BLAKE2b-256 | 79b796c2e589a0273363a81fe8db674da38f92128fd506e4b76cc30962ba443e |