Couchbase Python SDK 4.3

from couchbase.cluster import Cluster
from couchbase.auth import PasswordAuthenticator

cluster = Cluster('couchbase://your-ip', authenticator=PasswordAuthenticator('username', 'password'))
bucket = cluster.bucket('default')
coll = bucket.default_collection()


coll.upsert('key', 'value')
get_res = coll.get("key")
print('Get result - value: {}; CAS: {}'.format(get_res.content, get_res.cas))

# Output:
# Get result - value: value; CAS: 1617046112012992512

The Couchbase Python SDK allows Python applications to access a Couchbase cluster. The Python SDK uses the high-performance C++ library Couchbase++ to handle communicating to the cluster over Couchbase’s binary protocols.


Using Your Database

Learn

Take a deep-dive into the SDK concept material and learn more about Couchbase.

Resources

Useful resources to help support your development experience with Couchbase and the Python SDK.

This page covers using our operational Python SDK to connect to the Analytics Service of a Capella Operational or self-managed Couchbase Server cluster. As well as this row-based analytics service, a speedy, column-based analytics database is available for real-time analytics.

Operational Insights SDKs

SDKs for Operational Insights Enterprise — Couchbase’s analytical database for real time apps and operational intelligence (RT-OLAP) — are available for the .NET, Go, Java, Node.js, and Python platforms. See the Operational Insights Enterprise SDK pages for more information.

Currently, different SDKs are needed to connect to Operational Insights Capella — as this service does not have Operational Insights Enterprise’s load balancer, and uses a different connection protocol. Operational Insights Capella SDKs (also known as Columnar SDKs) are available for the Go, Java, Node.js, and Python platforms. See the Operational Insights Capella SDK pages for more information.