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.
Links
Documentation at readthedocs.org
Source code and issue tracking at GitHub.
History
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
Metadata
Release files for requests-cache 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | |
|---|---|---|---|
| requests-cache-0.4.0.zip | 37.1 kB | Details | |
| requests-cache-0.4.0.tar.gz | 23.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| requests-cache-0.4.0.win32.exe | Details |
Total release size: 276.8 kB
Release files / requests-cache-0.4.0.zip
| Download URL | requests-cache-0.4.0.zip |
|---|---|
| Size | 37.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c004f9f5b4d878e4cfeebac957e18c7963c181195b8c0e225c798c55748ca7f
|
|
BLAKE2b-256 checksum How to use checksums |
405803e7045fb2c21a4eb31be7b3482496c359a7b27d13e10291749f00cf4df1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / requests-cache-0.4.0.tar.gz
| Download URL | requests-cache-0.4.0.tar.gz |
|---|---|
| Size | 23.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3906fafc7fd3098f9ae64f0003cc2e2af85990b840b4786e492a042091af42a4
|
|
BLAKE2b-256 checksum How to use checksums |
d1768995cedf282e589be6650ac882e9c25c2129433f19811d4c0231eb36fcd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / requests-cache-0.4.0.win32.exe
| Download URL | requests-cache-0.4.0.win32.exe |
|---|---|
| Size | 216.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ad6e34074339ed6673135fb37e247691aae641af5b8220c764587e966146778
|
|
BLAKE2b-256 checksum How to use checksums |
77b632e3cc11ecf3cf5acea1421490d21954791fca15d7bda86aa3753da4f89e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |