Skip to main content

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

MIT © Ramiro Gómez

Project details


Release history Release notifications

This version

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fscache, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size fscache-0.1.0-py2.py3-none-any.whl (5.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size fscache-0.1.0.tar.gz (7.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page