Note: CouchDB-Python is no longer being maintained. After 8 years of maintaining CouchDB-Python, I no longer have time to address open issues and new bug reports. Consider https://github.com/cloudant/python-cloudant as an alternative. If you're interested in taking over maintenance of CouchDB-Python, please start a discussion on the mailing list, or open an issue or PR.
A Python library for working with CouchDB. Downloads are available via PyPI. Our documentation is also hosted there. We have a mailing list.
This package currently encompasses four primary modules:
couchdb.client
: the basic client librarycouchdb.design
: management of design documentscouchdb.mapping
: a higher-level API for mapping between CouchDB documents and Python objectscouchdb.view
: a CouchDB view server that allows writing view functions in Python
It also provides a couple of command-line tools:
couchdb-dump
: writes a snapshot of a CouchDB database (including documents, attachments, and design documents) to MIME multipart filecouchdb-load
: reads a MIME multipart file as generated by couchdb-dump and loads all the documents, attachments, and design documents into a CouchDB databasecouchdb-replicate
: can be used as an update-notification script to trigger replication between databases when data is changed
Prerequisites:
- Python 2.7, 3.4 or later
- CouchDB 0.10.x or later (0.9.x should probably work, as well)
simplejson
will be used if installed.
We run tests against CouchDB 1.6.1 since that is where most of the tests should pass:
Ubuntu Bionic:
docker network create couchdb-python docker run --network couchdb-python --rm --detach --publish 5984:5984 --name couchdb-test couchdb:1.6.1 docker run --network couchdb-python --env COUCHDB_URL="http://couchdb-test:5984/" --rm --detach -ti --volume $PWD:/build --name couchdb-python-build ubuntu:18.04 docker exec couchdb-python-build apt-get update docker exec --tty --interactive couchdb-python-build apt-get -y install python3-stdeb fakeroot python-all dh-python docker exec --workdir /build couchdb-python-build python3 setup.py egg_info --tag-build ~bionic1 sdist docker exec --workdir /build couchdb-python-build python3 setup.py --command-packages=stdeb.command egg_info --tag-build ~bionic1 bdist_deb docker stop couchdb-test docker stop couchdb-python-build docker network rm couchdb-python
Ubuntu Focal:
docker network create couchdb-python docker run --network couchdb-python --rm --detach --publish 5984:5984 --name couchdb-test couchdb:1.6.1 docker run --network couchdb-python --env COUCHDB_URL="http://couchdb-test:5984/" --rm --detach -ti --volume $PWD:/build --name couchdb-python-build ubuntu:20.04 docker exec couchdb-python-build apt-get update docker exec --tty --interactive couchdb-python-build apt-get -y install python3-stdeb fakeroot python-all dh-python docker exec --workdir /build couchdb-python-build python3 setup.py egg_info --tag-build ~focal1 sdist docker exec --workdir /build couchdb-python-build python3 setup.py --command-packages=stdeb.command egg_info --tag-build ~focal1 bdist_deb docker stop couchdb-test docker stop couchdb-python-build docker network rm couchdb-python