Skip to main content

A collection of CouchDB utils.

Project description

couchutils: Python CouchDB Utils

Travis (.org) Codecov GitHub PyPI Code Style: black

A collection of CouchDB utils.

Feature Support

  • Support for CouchDB 1.7.x.

couchutils officially supports Python 3.6+.

Installation

To install couchutils, simply run:

$ pip install -U couchutils
✨🛋✨

Documentation

To use couchutils in a project:

>>> from couchutils import <UTILS_METHOD>

Build CouchDB Documents from a Directory

>>> from couchutils import compile_doc
>>> compile_doc.compile_docs("<DOC_DIR>")
{...}

E.g. If passed a directory tree with:

.
├── example1
│   ├── _id
│   ├── language
│   └── views
│       └── numbers
│           ├── map.js
│           └── reduce
├── example2
│   └── _id
└── ignored.txt

The compiled output would be:

>>> compile_doc.compile_docs(".")
{
    "_design/example1": {"_id": "_design/minimal"},
    "_design/example2": {
        "views": {
            "numbers": {
                "reduce": "_count",
                "map": "function (doc) {\n  if (doc.name) {\n    emit(doc.name, null);\n  }\n}",
            }
        },
        "_id": "_design/basic",
        "language": "javascript",
    },
}

Ref: tests/fixtures/compile_docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

couchutils-0.4.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

couchutils-0.4.0-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page