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.7.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.7.0.tar.gz | 185.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| couchbase_connect_py-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 252.4 kB
Release files / couchbase_connect_py-0.7.0.tar.gz
| Download URL | couchbase_connect_py-0.7.0.tar.gz |
|---|---|
| Size | 185.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ff65599dfdc4611b435bbd593ae54a3f38e4c9cf236ad80da4bc2c885912e52
|
|
BLAKE2b-256 checksum How to use checksums |
21cae6c6d397a7b97b430a6bd48a39eddec5f6411cfecc9dc8ce6e1a596add3e
|
| 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.7.0-py3-none-any.whl
| Download URL | couchbase_connect_py-0.7.0-py3-none-any.whl |
|---|---|
| Size | 67.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4cba5ec254f1fb56e4bd76c6bbd1baa3d933b6492b40061cb078e29e6e95ae31
|
|
BLAKE2b-256 checksum How to use checksums |
d0d7d0f146dfb4257f81093fb834cf06957d1b0b9081385be73381ebbec51d89
|
| 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
|