Asynchronous client for CouchDB
Project description
Async-Couch
Resources
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.6
Allowed http client
How to install
pip install async-couch
Get Started
import asyncio
from async_couch import get_couch_client
from async_couch.http_clients import HttpxCouchClient
async def example(client, doc_id: str):
await client.db_create('test_index')
await client.doc_create_or_update('test_index', 'test_doc', dict(val=1))
response = await client.doc_get('my_index', response.model._id)
assert response.model._id == 'test_doc'
await client.attachment_upload(
'my_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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
async-couch-0.1a1.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for async_couch-0.1a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7da3bc5f95f88ab0a457fea4cfee27fb5682e618cd56f0bedaeee3ce5fa777f3 |
|
MD5 | 048639259df576cdbbe335e2c07d2928 |
|
BLAKE2b-256 | 5676b2f833c293c6b89a52b074adf2dd35f767e5b1c86e8b2275fe2b7ed57f7b |