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.3.0.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for fscache-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d438af7b528b199e2e7c6229a275affeaab4cb6d40890b8e254d5bf2c7863f7c |
|
MD5 | bfb8f25931617bae4e83c422b09948e0 |
|
BLAKE2b-256 | bbc9268536b68dea3a72a585497c24ecc418403053385602f4a5b00eb76b0d19 |