couchbase-connect-py
Python helper for connecting to Couchbase Server or Capella through a unified interface, with cluster creation and bucket/scope/collection/index automation.
Install
pip install .
Quick start
from couchbase_connect import CouchbaseConfig, resolve
# Couchbase Server
config = (
CouchbaseConfig()
.host("127.0.0.1")
.with_username("Administrator")
.with_password("password")
.ssl(False)
.bucket("demo")
)
db = resolve(config)
db.connect(config)
db.create_bucket("demo", quota=128, replicas=0)
db.create_primary_index()
db.disconnect()
# Capella (when capella.token is set)
capella = (
CouchbaseConfig()
.token("...")
.project("my-project")
.database("my-cluster")
.user_email("user@example.com")
.with_username("dbuser")
.with_password("dbpass")
)
db = resolve(capella)
db.connect(capella)
Context manager
from couchbase_connect import CouchbaseConfig, open_connection
with open_connection(config) as db:
db.upsert("doc-1", {"hello": "world"})
Tests
# Unit tests
pytest -m "not server and not capella"
# Couchbase Server integration (Docker / testcontainers)
pytest -m server
# Capella integration (copy example property files under tests/resources/)
cp tests/resources/test.capella.2.properties.example tests/resources/test.capella.2.properties
# edit credentials, then:
pytest -m capella
Metadata
Release files for couchbase-connect-py 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| couchbase_connect_py-0.8.0.tar.gz | 185.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| couchbase_connect_py-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 252.4 kB
Release files / couchbase_connect_py-0.8.0.tar.gz
| Download URL | couchbase_connect_py-0.8.0.tar.gz |
|---|---|
| Size | 185.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
137588bb9d30da0da4bd8dc0efceeb896b2650bc095d89ec16d0ec29d1d25c1f
|
|
BLAKE2b-256 checksum How to use checksums |
cf6e6e7993f3cf4a7e89a475c779e451d26dd69e778db843ef54ca76d3df2eaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.17.1 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"26.6.2"},"implementation":{"name":"CPython","version":"3.12.10"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.0.16 11 Feb 2025","python":"3.12.10","system":{"name":"Darwin","release":"25.6.0"}} HTTPX2/2.7.0
|
Release files / couchbase_connect_py-0.8.0-py3-none-any.whl
| Download URL | couchbase_connect_py-0.8.0-py3-none-any.whl |
|---|---|
| Size | 67.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71b065d6af2354565e008dc2601a74712d254f46fd80cc5959fd23061e3c0496
|
|
BLAKE2b-256 checksum How to use checksums |
289e6d4c83ead60a73c9f90d86d5ab4d1e2d5fd29c0377005b1c27a8a5e05d5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.17.1 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"26.6.2"},"implementation":{"name":"CPython","version":"3.12.10"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.0.16 11 Feb 2025","python":"3.12.10","system":{"name":"Darwin","release":"25.6.0"}} HTTPX2/2.7.0
|