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.2.0.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for fscache-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc8293dc4f67b56d60daebb7c99ab27052894b5efe930f4d775453909398011d |
|
MD5 | 657c6261246fd1c1b3f7cfef0c375884 |
|
BLAKE2b-256 | e22bc87d7c57d3b22fc00eb4b664381420339e283c845fe53262dc0bd46c197e |