couchbase-columnar 1.0.1


pip install couchbase-columnar

  Latest version

Released: Oct 10, 2025

Project Links

Meta
Author: Couchbase, Inc.
Requires Python: >=3.8

Classifiers

Development Status
  • 5 - Production/Stable

License
  • OSI Approved :: Apache Software License

Intended Audience
  • Developers

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3
  • Python :: Implementation :: CPython

Topic
  • Database
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules

Couchbase Python Columnar Client

Python client for Couchbase Columnar

Currently Python 3.8 - Python 3.12 is supported.

The Columnar SDK supports static typing. Currently only mypy is supported. You mileage may vary (YMMV) with the use of other static type checkers (e.g. pyright).

Installing the SDK

Wheels are provided for linux, MacOS and Windows environments for supported Python versions (currently Python 3.8 - Python 3.12).

Note: It is strongly recommended to update pip, setuptools and wheel prior to installing the SDK: python3 -m pip install --upgrade pip setuptools wheel

Install the SDK via pip:

python3 -m pip install couchbase-columnar

Installing the SDK from source

If a compatible wheel is not available, the SDK's binary will need to be built from source:

  1. Follow the steps on the BUILDING page
  2. After the build succeeds, the SDK can be used by running Python scripts from within the cloned repository or the SDK can be installed via pip: python3 -m pip install <path to cloned repository>
  3. Install the typing-extensions dependency: python3 -m pip install typing-extensions

Using the SDK

Some more examples are provided in the examples directory.

Connecting and executing a query

from couchbase_columnar.cluster import Cluster
from couchbase_columnar.credential import Credential
from couchbase_columnar.options import QueryOptions


def main() -> None:
    # Update this to your cluster
    connstr = 'couchbases://--your-instance--'
    username = 'username'
    pw = 'Password!123'
    # User Input ends here.

    cred = Credential.from_username_and_password(username, pw)
    cluster = Cluster.create_instance(connstr, cred)

    # Execute a query and buffer all result rows in client memory.
    statement = 'SELECT * FROM `travel-sample`.inventory.airline LIMIT 10;'
    res = cluster.execute_query(statement)
    all_rows = res.get_all_rows()
    for row in all_rows:
        print(f'Found row: {row}')
    print(f'metadata={res.metadata()}')

    # Execute a query and process rows as they arrive from server.
    statement = 'SELECT * FROM `travel-sample`.inventory.airline WHERE country="United States" LIMIT 10;'
    res = cluster.execute_query(statement)
    for row in res.rows():
        print(f'Found row: {row}')
    print(f'metadata={res.metadata()}')

    # Execute a streaming query with positional arguments.
    statement = 'SELECT * FROM `travel-sample`.inventory.airline WHERE country=$1 LIMIT $2;'
    res = cluster.execute_query(statement, QueryOptions(positional_parameters=['United States', 10]))
    for row in res:
        print(f'Found row: {row}')
    print(f'metadata={res.metadata()}')

    # Execute a streaming query with named arguments.
    statement = 'SELECT * FROM `travel-sample`.inventory.airline WHERE country=$country LIMIT $limit;'
    res = cluster.execute_query(statement, QueryOptions(named_parameters={'country': 'United States',
                                                                          'limit': 10}))
    for row in res.rows():
        print(f'Found row: {row}')
    print(f'metadata={res.metadata()}')


if __name__ == '__main__':
    main()

Using the async API

from acouchbase_columnar import get_event_loop
from acouchbase_columnar.cluster import AsyncCluster
from couchbase_columnar.credential import Credential
from couchbase_columnar.options import QueryOptions


async def main() -> None:
    # Update this to your cluster
    connstr = 'couchbases://--your-instance--'
    username = 'username'
    pw = 'Password!123'
    # User Input ends here.

    cred = Credential.from_username_and_password(username, pw)
    cluster = AsyncCluster.create_instance(connstr, cred)

    # Execute a query and buffer all result rows in client memory.
    statement = 'SELECT * FROM `travel-sample`.inventory.airline LIMIT 10;'
    res = await cluster.execute_query(statement)
    all_rows = await res.get_all_rows()
    # NOTE: all_rows is a list, _do not_ use `async for`
    for row in all_rows:
        print(f'Found row: {row}')
    print(f'metadata={res.metadata()}')

    # Execute a query and process rows as they arrive from server.
    statement = 'SELECT * FROM `travel-sample`.inventory.airline WHERE country="United States" LIMIT 10;'
    res = await cluster.execute_query(statement)
    async for row in res.rows():
        print(f'Found row: {row}')
    print(f'metadata={res.metadata()}')

    # Execute a streaming query with positional arguments.
    statement = 'SELECT * FROM `travel-sample`.inventory.airline WHERE country=$1 LIMIT $2;'
    res = await cluster.execute_query(statement, QueryOptions(positional_parameters=['United States', 10]))
    async for row in res:
        print(f'Found row: {row}')
    print(f'metadata={res.metadata()}')

    # Execute a streaming query with named arguments.
    statement = 'SELECT * FROM `travel-sample`.inventory.airline WHERE country=$country LIMIT $limit;'
    res = await cluster.execute_query(statement, QueryOptions(named_parameters={'country': 'United States',
                                                                                'limit': 10}))
    async for row in res.rows():
        print(f'Found row: {row}')
    print(f'metadata={res.metadata()}')

if __name__ == '__main__':
    loop = get_event_loop()
    loop.run_until_complete(main())

Wheel compatibility matrix

Platform CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13
macosx_10_15_x86_64
macosx_11_0_arm64
manylinux2014_aarch64
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_x86_64
musllinux_1_1_x86_64
win_amd64

Files in release

couchbase_columnar-1.0.1-cp310-cp310-macosx_10_15_x86_64.whl (4.2MiB)
couchbase_columnar-1.0.1-cp310-cp310-macosx_11_0_arm64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0MiB)
couchbase_columnar-1.0.1-cp310-cp310-musllinux_1_1_x86_64.whl (4.5MiB)
couchbase_columnar-1.0.1-cp310-cp310-win_amd64.whl (2.2MiB)
couchbase_columnar-1.0.1-cp311-cp311-macosx_10_15_x86_64.whl (4.2MiB)
couchbase_columnar-1.0.1-cp311-cp311-macosx_11_0_arm64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0MiB)
couchbase_columnar-1.0.1-cp311-cp311-musllinux_1_1_x86_64.whl (4.5MiB)
couchbase_columnar-1.0.1-cp311-cp311-win_amd64.whl (2.2MiB)
couchbase_columnar-1.0.1-cp312-cp312-macosx_10_15_x86_64.whl (4.2MiB)
couchbase_columnar-1.0.1-cp312-cp312-macosx_11_0_arm64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0MiB)
couchbase_columnar-1.0.1-cp312-cp312-musllinux_1_1_x86_64.whl (4.5MiB)
couchbase_columnar-1.0.1-cp312-cp312-win_amd64.whl (2.2MiB)
couchbase_columnar-1.0.1-cp313-cp313-macosx_10_15_x86_64.whl (4.2MiB)
couchbase_columnar-1.0.1-cp313-cp313-macosx_11_0_arm64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0MiB)
couchbase_columnar-1.0.1-cp313-cp313-musllinux_1_1_x86_64.whl (4.5MiB)
couchbase_columnar-1.0.1-cp313-cp313-win_amd64.whl (2.2MiB)
couchbase_columnar-1.0.1-cp39-cp39-macosx_10_15_x86_64.whl (4.2MiB)
couchbase_columnar-1.0.1-cp39-cp39-macosx_11_0_arm64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (3.8MiB)
couchbase_columnar-1.0.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0MiB)
couchbase_columnar-1.0.1-cp39-cp39-musllinux_1_1_x86_64.whl (4.5MiB)
couchbase_columnar-1.0.1-cp39-cp39-win_amd64.whl (2.2MiB)
couchbase_columnar-1.0.1.tar.gz (5.7MiB)
Extras: None
Dependencies:
typing-extensions (~=4.11)