Skip to main content

llama-index readers couchbase integration

Project description

LlamaIndex Readers Integration: Couchbase

pip install llama-index-readers-couchbase

This loader loads documents from Couchbase cluster. The user specifies a Couchbase client or credentials to initialize the reader. They can specify the SQL++ query to fetch the relevant docs.

Usage

Here's an example usage of the CouchbaseReader.

import os

from llama_index.readers.couchbase import CouchbaseReader

connection_string = (
    "couchbase://localhost"  # valid Couchbase connection string
)
db_username = "<valid_database_user_with_read_access_to_bucket_with_data>"
db_password = "<password_for_database_user>"

# query is a valid SQL++ query that is passed to client.query()
query = """
    SELECT h.* FROM `travel-sample`.inventory.hotel h
        WHERE h.country = 'United States'
        LIMIT 5
        """

reader = CouchbaseLoader(
    connection_string=connection_string,
    db_username=db_username,
    db_password=db_password,
)

# It is also possible to pass an initialized Couchbase client to the document loader
# from couchbase.auth import PasswordAuthenticator  # noqa: E402
# from couchbase.cluster import Cluster # noqa: E402
# from couchbase.options import ClusterOptions # noqa: E402

# auth = PasswordAuthenticator(
#    db_username,
#    db_password,
# )

# couchbase_client = Cluster(connection_string, ClusterOptions(auth))
# reader = CouchbaseLoader(client=couchbase_client)

# fields to be written to the document
text_fields = ["name", "title", "address", "reviews"]

# metadata fields to be written to the document's metadata
metadata_fields = (["country", "city"],)

documents = reader.load_data(
    query=query, text_fields=text_fields, metadata_fields=metadata_fields
)

This loader is designed to be used as a way to load data into LlamaIndex. See here for examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_couchbase-0.5.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_couchbase-0.5.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_couchbase-0.5.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_couchbase-0.5.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_couchbase-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d68060a4842222ca1332ec08138c0879d3958e5263cb3fbc82069c00fc8d2a62
MD5 3bfb6b943dad2ed14b9c24ef9f3104c9
BLAKE2b-256 4c7e831de0570ee7d087ed8ccfa30155b7ec172662f687dcda729a3a1160b211

See more details on using hashes here.

File details

Details for the file llama_index_readers_couchbase-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_readers_couchbase-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_couchbase-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5708c54447e27d53c35badc065bdc16091993fa6e19c45bd8ce52f819cbe91d8
MD5 a84f0997ebbdc91c0821a8ca0d9d994b
BLAKE2b-256 2dca036b030fbf7a75c7790936ff90ea64b8a1b4d6089afa4629e7acc11b28e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page