Skip to main content

Persistent cache for requests library

Project description

requests-cache

Requests-cache is a transparent persistent cache for requests library.

Usage example

Just write:

import requests
import requests_cache

requests_cache.configure('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.

History

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.2.0.zip (30.9 kB view details)

Uploaded Source

requests-cache-0.2.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

requests-cache-0.2.0.win32.exe (210.0 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for requests-cache-0.2.0.zip
Algorithm Hash digest
SHA256 92112163c7483b7bf77cc1c7c9f6432834f1b6e78e82ee3344c56edfe2346298
MD5 3e39ab1a4934958f0c651d53ba005c41
BLAKE2b-256 d2eb2506691b0f153409299c7aba2ebf2569409f9f4f7f9ec3214215ced8406f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for requests-cache-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4b4ca8c8ba289543a53891c3e09853b4e881c2dfcf8629db7900994f6b3aeb3d
MD5 bbcde087a0535c5ebdaf4caace008b74
BLAKE2b-256 5b606177e45b1960568019601e7a2f625c45e842517274865f81962172ac08f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for requests-cache-0.2.0.win32.exe
Algorithm Hash digest
SHA256 685c84b444c79770e3f0ee103cdbfc245100b533d500b7b3ea1409ed37b50473
MD5 cef34ed8fd07e98c76219114da0d4e32
BLAKE2b-256 d849d4393ccee59381bdc1b06598c119449fbf904fd6aedc82c670225cc08714

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