Skip to main content

License PyPI version Python package codecov Documentation Status

aiocouch

An asynchronous client library for CouchDB 2.0 based on asyncio using aiohttp

Key features

  • All requests are asynchronus using aiohttp
  • Supports CouchDB 2.x and 3.x
  • Support for modern Python ≥ 3.7

Library installation

    pip install aiocouch

Getting started

The following code retrieves and prints the list of incredients of the apple_pie recipe. The incredients are stored as a list in the apple_pie aiocouch.document.Document, which is part of the recipe aiocouch.database.Database. We use the context manager aiocouch.CouchDB to create a new session.

    from aiocouch import CouchDB

    async with CouchDB(
        "http://localhost:5984", user="admin", password="admin"
    ) as couchdb:
        db = await couchdb["recipes"]
        doc = await db["apple_pie"]
        print(doc["incredients"])

We can also create new recipes, for instance for some delicious cookies.

        new_doc = await db.create(
            "cookies", data={"title": "Granny's cookies", "rating": "★★★★★"}
        )
        await new_doc.save()

For further details please refer to the documentation, which is available here on readthedocs.org.

Run examples

  • Setup the CouchDB URL and credentials using the environment variables
  • Install dependencies using pip install --editable '.[examples]'
  • run for instance python examples/getting_started.py

Run tests

  • Install dependencies using pip install --editable '.[tests]'
  • Setup the CouchDB URL and credentials using the environment variables (COUCHDB_HOST, COUCHDB_USER, COUCHDB_PASS)
  • run pytest --cov=aiocouch

Generate documentation

  • Install dependencies using pip install '.[docs]'
  • switch to the docs directory: cd docs
  • run make html

Metadata

Release files for aiocouch 4.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiocouch 4.0.1
File Size Uploaded
aiocouch-4.0.1.tar.gz 45.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiocouch 4.0.1
File Interpreter ABI Platform
aiocouch-4.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 80.4 kB

Release files / aiocouch-4.0.1.tar.gz

Download URL aiocouch-4.0.1.tar.gz
Size 45.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eeb46afe7626bd067c5a759fdd7c5eea11c4ac47c509751405a5e383081be7ab
BLAKE2b-256 checksum
How to use checksums
5fed213816310793a43577a9ff402a8f232d4fe2ee7e17b2b39cadd0f4a0bc02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / aiocouch-4.0.1-py3-none-any.whl

Download URL aiocouch-4.0.1-py3-none-any.whl
Size 34.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f664150ee6f580fcacf6a6ef3b55e3304a7a352b91f3b88e139b4e2b09ffea44
BLAKE2b-256 checksum
How to use checksums
eac9530814ac26853680bbf46f07f1f39a81abf3a8631844a9587c4738436d73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

4.0.1 This release

2 release files

4.0.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page