Metadata-Version: 2.1
Name: httpx-caching
Version: 0.1a3
Summary: Caching for HTTPX.
Home-page: https://github.com/johtso/httpx-caching
Author: Johannes (johtso)
Author-email: johtso@gmail.com
License: Apache-2.0
Project-URL: Source, https://github.com/johtso/httpx-caching
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.7
Description-Content-Type: text/markdown

<p align="center">Caching for HTTPX.</em></p>

<p align="center">
<a href="https://github.com/johtso/httpx-caching/actions">
    <img src="https://github.com/johtso/httpx-caching/workflows/Test%20Suite/badge.svg" alt="Test Suite">
</a>
<a href="https://pypi.org/project/httpx-caching/">
    <img src="https://badge.fury.io/py/httpx-caching.svg" alt="Package version">
</a>
</p>

**Note**: Early development / alpha, use at your own risk.

This package adds caching functionality to [HTTPX](https://github.com/encode/httpx)

Adapted from Eric Larson's fantastic [CacheControl](https://github.com/ionrock/cachecontrol) for [requests](https://requests.readthedocs.io/en/stable/).

Project goals:
- [x] Sans-io caching protocol
- [x] Fully async compatible
- [ ] Support multiple http clients (currently only supports httpx)

Limitations:
* Currently only has in-memory cache storage (async redis would be nice!)
* Test suite was taken wholesale from CacheControl, so still uses a test server and mocking rather than taking advantage of the sans-io implementation. 

**Usage:**

```python
import asyncio

from httpx import AsyncClient
from httpx_caching import CachingClient

client = AsyncClient()
client = CachingClient(client)

async def run_example():
    await client.get("http://example.com")
    
loop = asyncio.get_event_loop()
loop.run_until_complete(run_example())
```


**Documentation:**

TODO

See [CacheControl's documentation](https://cachecontrol.readthedocs.io/en/latest/index.html) for general documentation of the caching approach.


