Metadata-Version: 2.4
Name: couchbase-connect-py
Version: 0.5.0
Summary: Couchbase Server and Capella connection helper with cluster, bucket, and index automation
Project-URL: Homepage, https://github.com/mminichino/couchbase-connect-py
Author-email: Michael Minichino <info@unix.us.com>
License: Apache-2.0
License-File: LICENSE.txt
Keywords: capella,couchbase,database,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: couchbase>=4.6.2
Requires-Dist: dnspython>=2.8.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: restfull>=2.0.2
Requires-Dist: tenacity>=9.1.4
Requires-Dist: typer>=0.19.0
Description-Content-Type: text/markdown

# 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

```bash
pip install .
```

## Quick start

```python
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

```python
from couchbase_connect import CouchbaseConfig, open_connection

with open_connection(config) as db:
    db.upsert("doc-1", {"hello": "world"})
```

## Tests

```bash
# 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
```
