# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-requests-cache VERSION= 1.2.1 KEYWORDS= python VARIANTS= v12 v13 SDESC[v12]= Persistent cache for python requests (3.12) SDESC[v13]= Persistent cache for python requests (3.13) HOMEPAGE= https://github.com/requests-cache/requests-cache CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/4e/2e/8f4051119f460cfc786aa91f212165bb6e643283b533db572d7b33952bd2 DISTFILE[1]= requests_cache-1.2.1-py3-none-any.whl:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v12]= single SPKGS[v13]= single OPTIONS_AVAILABLE= PY312 PY313 OPTIONS_STANDARD= none VOPTS[v12]= PY312=ON PY313=OFF VOPTS[v13]= PY312=OFF PY313=ON DISTNAME= requests_cache-1.2.1.dist-info GENERATED= yes [PY312].RUN_DEPENDS_ON= python-attrs:single:v12 python-cattrs:single:v12 python-platformdirs:single:v12 python-requests:single:v12 python-url-normalize:single:v12 python-urllib3:single:v12 [PY312].USES_ON= python:v12,wheel [PY313].RUN_DEPENDS_ON= python-attrs:single:v13 python-cattrs:single:v13 python-platformdirs:single:v13 python-requests:single:v13 python-url-normalize:single:v13 python-urllib3:single:v13 [PY313].USES_ON= python:v13,wheel [FILE:2763:descriptions/desc.single] [![]](https://requests-cache.readthedocs.io) [Build] [Codecov] [Documentation] [Code Shelter] [PyPI] [Conda] [![PyPI - Python Versions]](https://pypi.org/project/requests-cache) [![PyPI - Downloads]](https://pypi.org/project/requests-cache) ## Summary **requests-cache** is a persistent HTTP cache that provides an easy way to get better performance with the python [requests] library. Complete project documentation can be found at [requests-cache.readthedocs.io]. ## Features * 🍰 **Ease of use:** Keep using the `requests` library you're already familiar with. Add caching with a [drop-in replacement] for `requests.Session`, or [install globally] to add transparent caching to all `requests` functions. * 🚀 **Performance:** Get sub-millisecond response times for cached responses. When they expire, you still save time with [conditional requests]. * 💾 **Persistence:** Works with several [storage backends] including SQLite, Redis, MongoDB, and DynamoDB; or save responses as plain JSON files, YAML, and more * 🕗 **Expiration:** Use [Cache-Control] and other standard HTTP headers, define your own expiration schedule, keep your cache clutter-free with backends that natively support TTL, or any combination of strategies * ⚙️ **Customization:** Works out of the box with zero config, but with a robust set of features for configuring and extending the library to suit your needs * 🧩 **Compatibility:** Can be combined with other [popular libraries based on requests] ## Quickstart First, install with pip: ```bash pip install requests-cache ``` Then, use [requests_cache.CachedSession] to make your requests. It behaves like a normal [requests.Session], but with caching behavior. To illustrate, we'll call an endpoint that adds a delay of 1 second, simulating a slow or rate-limited website. **This takes 1 minute:** ```python import requests session = requests.Session() for i in range(60): session.get('https://httpbin.org/delay/1') ``` **This takes 1 second:** ```python import requests_cache session = requests_cache.CachedSession('demo_cache') for i in range(60): session.get('https://httpbin.org/delay/1') ``` With caching, the response will be fetched once, saved to `demo_cache.sqlite`, and subsequent requests will return the cached response near-instantly. ### Patching If you don't want to manage a session object, or just want to quickly test it out in your application without modifying any code, requests-cache can also be installed globally, and all requests will be transparently cached: ```python import requests import requests_cache requests_cache.install_cache('demo_cache') requests.get('https://httpbin.org/delay/1') ``` [FILE:127:distinfo] 1285151cddf5331067baa82598afe2d47c7495a1334bfe7a7d329b43e9fd3603 61425 python-src/requests_cache-1.2.1-py3-none-any.whl