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.1.0.tar.gz
(7.4 kB
view hashes)
Built Distribution
Close
Hashes for fscache-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83bee287506015cf02010935751db048a34860186ad8b053d326d4cfd1db1a0e |
|
MD5 | 343b0af4c6d34ffba9f1e085c64102ca |
|
BLAKE2b-256 | 8499d96d7abaa301c63c6b0159845455862205b5d5385202322dc8e0c806f7ef |