https://github.com/symstu/async-couch
Asynchronous client for CouchDb for Python. Currently implemented base operations with indexes and documents
https://github.com/symstu/async-couch
aiohttp asyncio couchdb erlang erlang-libraries httpx python
Last synced: 2 months ago
JSON representation
Asynchronous client for CouchDb for Python. Currently implemented base operations with indexes and documents
- Host: GitHub
- URL: https://github.com/symstu/async-couch
- Owner: symstu
- License: mit
- Created: 2020-04-15T20:42:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T00:17:02.000Z (about 1 year ago)
- Last Synced: 2025-07-18T07:44:26.137Z (3 months ago)
- Topics: aiohttp, asyncio, couchdb, erlang, erlang-libraries, httpx, python
- Language: Python
- Homepage:
- Size: 267 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Async-Couch



## Resources
* [Documentation](https://async-couch.readthedocs.io/en/latest/)> This is simple asynchronous python CouchDB client that works with
> aiohttp, httpx and able to be adopted easily to any other http client.### Requirements:
* >= Python 3.11### Allowed http client
* [aiohttp](https://docs.aiohttp.org/en/stable/>)
* [httpx](https://www.python-httpx.org/>)### How to install
```bash
pip install async-couch
```### Get Started
```python
import asynciofrom async_couch import get_couch_client
from async_couch.http_clients import HttpxCouchClientasync def example(client, doc_id: str):
await client.db_create('test_index')
await client.doc_create_or_update('test_index', doc_id, dict(val=1))response = await client.doc_get('test_index', response.model._id)
assert response.model._id == doc_idawait client.attachment_upload(
'test_index', response.model._id, 'attachment_name', 'text/plain', b'\0')if __name__ == '__main__':
loop = asyncio.get_event_loop()
client = get_couch_client(request_adapter=HttpxCouchClient)loop.run_until_complete(example(client, 'document_name'))
```### ToDo
* Rest endpoints
* Aiohttp adapter