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.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.3.0.zip (33.8 kB view details)

Uploaded Source

requests-cache-0.3.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

requests-cache-0.3.0.win32.exe (214.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for requests-cache-0.3.0.zip
Algorithm Hash digest
SHA256 7faaeb10985f23196cecd828a7fb68a1546b842cedbe11268406d4ff21bc43f1
MD5 037d459e6c4aaaaa849af8c694a0c63d
BLAKE2b-256 233fb5a29a090434b1bd8946d26c417f9811a304c78a431e68bb96499bdeda0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for requests-cache-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cb723ae5db7423b01b77ad66d6984436e6f35a7a06a8e73f98cfaff49e5b5160
MD5 9d69f19a635908e0bb815d77bfc35c2b
BLAKE2b-256 d338495adb36ec25db7569aaedb12470026f7fe6d4b5f1785f5bdc48ca9e2e58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for requests-cache-0.3.0.win32.exe
Algorithm Hash digest
SHA256 da834dc4a66b95e38564a7a0c64a8eb9381be4694fda10fc1f6c0fad29936569
MD5 9e8366fa532c61445100252d6719aecb
BLAKE2b-256 bde6d4984090203d238ca696666d4000fc10afa0b8ff7fa003fed81317286afd

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