couchbase
Python Client for Couchbase
What it is and what it does
The Couchbase Python client is an official SDK for connecting Python applications to Couchbase Server, a distributed NoSQL database. It provides APIs for key-value operations, N1QL queries, full-text search, and analytics, with support for both synchronous and asynchronous patterns. The library is built on top of libcouchbase and requires a C++17 compiler and OpenSSL for compilation from source, though prebuilt wheels are available for Python 3.10, 3.11, and 3.12 on Windows, macOS, and Linux.
The package has been in active development since its first release and is currently in production-stable status. It depends only on typing-extensions for runtime and is actively maintained, with the latest release 57 days old. The library supports Python 3.7 and later, though wheels are provided for more recent versions. Installation typically requires system-level dependencies (compiler, CMake, OpenSSL) unless a prebuilt wheel is available for your platform.
Use it for:
- Building web applications that need fast document storage and retrieval with Couchbase as the backend database.
- Running N1QL queries against Couchbase clusters to aggregate or filter document data from Python code.
- Implementing real-time analytics pipelines that read from and write to Couchbase Server.
- Developing microservices that require distributed key-value caching and persistence.
- Migrating from other NoSQL databases to Couchbase while maintaining Python compatibility.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client library for connecting to and querying Couchbase Server, a NoSQL database, with support for key-value operations, queries, and document management.
Yes, with conditions. Install if you are already committed to Couchbase Server as your database and need a stable, officially-supported Python client. The permissive Apache License 2.0 and active maintenance are strong positives. However, be aware of one known vulnerability (PYSEC-2023-235) that needs verification for this release, and plan for medium install friction on platforms without prebuilt wheels. Not suitable if you need to avoid compiled C++ dependencies or are evaluating database options.
Install
couchbase on PyPI
pip
pip install couchbaseuv
uv add couchbasepoetry
poetry add couchbaseInstalling couchbase
Before you install
Medium install friction due to compiled C++ dependencies (requires C++17 compiler support and OpenSSL). Prebuilt wheels available for Python 3.10, 3.11, 3.12 on Windows, macOS, and Linux, reducing friction on common platforms. Active maintenance with recent releases.
License in practice
Licensed under Apache License 2.0 (permissive), allowing commercial and private use with minimal restrictions. No copyleft obligations.
Quickstart
pip install couchbase
from couchbase.cluster import Cluster
from couchbase.auth import PasswordAuthenticator
cluster = Cluster('couchbase://localhost', PasswordAuthenticator('user', 'password'))
bucket = cluster.bucket('bucket_name')
collection = bucket.default_collection()
result = collection.get('document_id')
Requires a running Couchbase Server instance. On source builds, requires C++17 compiler, CMake >= 3.18, OpenSSL development files, and Python development headers.
Verify before relying
- Whether PYSEC-2023-235 affects the current 4.6.2 release or has been patched
- Specific performance characteristics or throughput limits under typical workloads
- Full feature parity between 4.x and older 3.x versions beyond stated compatibility
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 57 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 859,822/month — #4,876 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | 1 — PYSEC-2023-235 |
Evidence: couchbase-4.6.2-cp310-cp310-macosx_10_15_x86_64.whl; couchbase-4.6.2-cp310-cp310-macosx_11_0_arm64.whl; couchbase-4.6.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; couchbase-4.6.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; couchbase-4.6.2-cp310-cp310-musllinux_1_2_x86_64.whl; couchbase-4.6.2-cp310-cp310-win_amd64.whl; couchbase-4.6.2-cp311-cp311-macosx_10_15_x86_64.whl; couchbase-4.6.2-cp311-cp311-macosx_11_0_arm64.whl; couchbase-4.6.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; couchbase-4.6.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; couchbase-4.6.2-cp311-cp311-musllinux_1_2_x86_64.whl; couchbase-4.6.2-cp311-cp311-win_amd64.whl; couchbase-4.6.2-cp312-cp312-macosx_10_15_x86_64.whl; couchbase-4.6.2-cp312-cp312-macosx_11_0_arm64.whl; couchbase-4.6.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; couchbase-4.6.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; couchbase-4.6.2-cp312-cp312-musllinux_1_2_x86_64.whl; couchbase-4.6.2-cp312-cp312-win_amd64.whl; couchbase-4.6.2-cp313-cp313-macosx_10_15_x86_64.whl; couchbase-4.6.2-cp313-cp313-macosx_11_0_arm64.whl
Keywords: couchbase, nosql, pycouchbase, libcouchbase
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
happybaseHappyBase is a Python library that provides a…
permissive · top 15,000 on PyPI
google-cloud-firestorePython client library for Google Cloud…
permissive · top 1,000 on PyPI
google-cloud-datastorePython client library for Google Cloud…
permissive · top 5,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
aerospikePython client library for connecting to and…
permissive · top 15,000 on PyPI
borneoPython SDK for connecting to Oracle NoSQL…
unclear · top 15,000 on PyPI
mysqlclientmysqlclient provides a Python interface to…
copyleft · top 1,000 on PyPI
pycupsProvides Python bindings to the CUPS printing…
copyleft · top 15,000 on PyPI
CouchDBA Python client library for interacting with…
permissive · top 15,000 on PyPI
ibmcloudantPython client library for IBM Cloudant and…
permissive · top 5,000 on PyPI