Skip to main content

requests etag cache

Project description

Installation

$ [sudo] pip install requests-etag-cache

How it works

$REQUESTS_ETAG_CACHE/<url_hash>

$XDG_CACHE_HOME/requests-etag-cache/<url_hash> by default

Functions

function __doc__
requests_etag_cache.clear() remove all cache keys
requests_etag_cache.get(response) get cached etag value
requests_etag_cache.rm(response) remove response cache
requests_etag_cache.save(response) save response etag value
requests_etag_cache.uptodate(response) return True if response is cached, else False

Examples

import requests
import requests_etag_cache

r = requests.get('https://pypi.org/project/requests/')
if not requests_etag_cache.uptodate(r):
    ...
    requests_etag_cache.save(r)

python-readme-generator

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

requests-etag-cache-2019.9.25.tar.gz (1.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page