Skip to main content

Persistent cache for requests library

Project description

requests-cache

Requests-cache is a transparent persistent cache for requests (version >= 1.1.0) library.

Usage example

Just write:

import requests
import requests_cache

requests_cache.install_cache('demo_cache')

And all responses with headers and cookies will be transparently cached to demo_cache.sqlite database. For example, following code will take only 1-2 seconds instead 10, and will run instantly on next launch:

for i in range(10):
    requests.get('http://httpbin.org/delay/1')

It can be useful when you are creating some simple data scraper with constantly changing parsing logic or data format, and don’t want to redownload pages or write complex error handling and persistence.

Note

requests-cache ignores all cache headers, it just caches the data for the time you specify.

History

0.4.1 (2013-08-19)

  • requests_cache.enabled() context manager

  • Compatibility with Requests 1.2.3 cookies handling

0.4.0 (2013-04-25)

  • Redis backend. Thanks to @michaelbeaumont

  • Fix for changes in Requests 1.2.0 hooks dispatching

0.3.0 (2013-02-24)

  • Support for Requests 1.x.x

  • CachedSession

  • Many backward incompatible changes

0.2.1 (2013-01-13)

  • Fix broken PyPi package

0.2.0 (2013-01-12)

  • Last backward compatible version for Requests 0.14.2

0.1.3 (2012-05-04)

  • Thread safety for default sqlite backend

  • Take into account the POST parameters when cache is configured with ‘POST’ in allowable_methods

0.1.2 (2012-05-02)

  • Reduce number of sqlite database write operations

  • fast_save option for sqlite backend

0.1.1 (2012-04-11)

  • Fix: restore responses from response.history

  • Internal refactoring (MemoryCache -> BaseCache, reduce_response and restore_response moved to BaseCache)

  • connection option for MongoCache

0.1.0 (2012-04-10)

  • initial PyPI release

Project details


Download files

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

Source Distributions

requests-cache-0.4.1.zip (37.6 kB view details)

Uploaded Source

requests-cache-0.4.1.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

requests-cache-0.4.1.win32.exe (216.4 kB view details)

Uploaded Source

File details

Details for the file requests-cache-0.4.1.zip.

File metadata

  • Download URL: requests-cache-0.4.1.zip
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for requests-cache-0.4.1.zip
Algorithm Hash digest
SHA256 1ab7a6c1ef739c39887abbf8587be1f432a571e8d7f76a4ee57e02199d32ab12
MD5 1ccb0b9084f2ce0461f40d45b96d77c2
BLAKE2b-256 140914a11cee63494959d4a3ee62adb12c818d23d6f3dc879cd2b875dbb08f5f

See more details on using hashes here.

File details

Details for the file requests-cache-0.4.1.tar.gz.

File metadata

File hashes

Hashes for requests-cache-0.4.1.tar.gz
Algorithm Hash digest
SHA256 127a6de6d0cf86b72a3ddff462bb112a878c7c8f0ca19227bd049a114da86b80
MD5 5148ad1d289db21f76fc2bb3b6f0e521
BLAKE2b-256 7b049bcf982a625d383058c1a289c33d410867d3375a29ab7dfa1f9b39add001

See more details on using hashes here.

File details

Details for the file requests-cache-0.4.1.win32.exe.

File metadata

File hashes

Hashes for requests-cache-0.4.1.win32.exe
Algorithm Hash digest
SHA256 90fea350804dc8acb484aa3c89410582edc6dfb8e61660e5f9429bd62ff1b9bf
MD5 c026c123df3a9dd9f973f1aaf553d498
BLAKE2b-256 7afc707b99702ad32b2daf9979f43cae6b8b4c9ea35c1d1b71d523184ddf8d04

See more details on using hashes here.

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