You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

aiocouchdb3

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aiocouchdb3

A client for interacting with CouchDB 3 based on aiohttp

0.1.5
pipPyPI
Maintainers
1

Async I/O for CouchDB built on aiohttp

This project is based on the (seemingly) unmaintained aiocoucdb but is not a drop-in replacement for that project.

Example

Using aiocouchdb3 is pretty easy.

import aiocouchdb3 as couchdb

user_jwt = get_user_jwt()
async with couchdb.connect() as client:
    async with client.with_token(user_jwt) as session:
        for db in await session.all_dbs:
            print(await db.info)

Features

  • Allows authentication for both username/password and JWT

Contribute

Thanks for considering adding your skills to improve this library. Please review the Contributor Covenant Code of Conduct. You must comply with it to contribute to aiocouchdb3.

Set up your local development environment

Check .python-version for the minimum version of Python supported by aiocouchdb3. Install that and use it to create a Poetry environment.

Install dependencies with

poetry install --all-extras

You must provide both mocked and integration tests when contributing. Get a CouchDB v3 instance up and running. (If you use Docker, see the following section about using Docker to run a properly configured CouchDB v3 instance.)

Running tests

There are two kinds of tests in the project found the ./tests directory.

  • ./tests/mocked contain proper unit tests isolated from the execution environment.

  • ./tests/integration contain integration tests that rely on a running instance of CouchDB. To run these copy ./test.env to ./.test.env and provide values for the two empty keys in it (and modify the other two if you want to).

    # Copy this file to .test.env and provide values for your
    # instance of CouchDB
    COUCHDB_USER =
    COUCHDB_PASSWORD =
    COUCHDB_DB_BASE_URL = http://locahost:5984
    COUCHDB_JWT_SECRET = devsecret
    

    There's a Docker compose file in tests available for you to use if you want to use that.

    docker compose --env-file .test.env -f tests/docker-compose/docker-compose.yaml up
    

    Run the tests with

    poetry run pytest
    

    If you want to run the tests while you're developing

    poetry run ptw .
    

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts