summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2021-03-03 09:06:29 -0600
committerJordan Cook <jordan.cook@pioneer.com>2021-03-03 09:06:29 -0600
commit38db0ddef8a41ee2434a5be4ccb6832264c5b754 (patch)
tree8cb3d5200f70a785302eedf4c91e938083de2204 /README.md
parentd424c38e59bca66492f90817a5990922b4b004d0 (diff)
downloadrequests-cache-38db0ddef8a41ee2434a5be4ccb6832264c5b754.tar.gz
Convert Readme to markdown
Diffstat (limited to 'README.md')
-rw-r--r--README.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b71baac
--- /dev/null
+++ b/README.md
@@ -0,0 +1,34 @@
+# requests-cache
+Requests-cache is a transparent persistent cache for the [requests](http://python-requests.org) library (version 2+).
+
+## Installation
+Install with pip:
+```
+pip install requests-cache
+```
+
+## Usage example
+```python
+import requests_cache
+
+requests_cache.install_cache('demo_cache')
+```
+
+And all responses with headers and cookies will be transparently cached to `demo_cache.sqlite`.
+For example, following the code will take only 1-2 seconds instead of 10, and will run instantly on next launch:
+
+```python
+import requests
+
+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.
+
+## Links
+- **Documentation** at [readthedocs](https://requests-cache.readthedocs.io)
+- **Source code and issue tracking** at [GitHub](https://github.com/reclosedev/requests-cache)
+- **Working example** at [Real Python](https://realpython.com/blog/python/caching-external-api-requests)