How can I retrieve the collection description with the python sdk

Description

After setting up the client like so:

from weaviate.classes.init import AdditionalConfig, Timeout
import os
import requests
import json

WEAVIATE_HOST = "localhost"
OPENAI_API_KEY = "sk-..."

client = weaviate.connect_to_local(
    host=WEAVIATE_HOST,
    port=8080,
    grpc_port=50051,
    headers={
        "X-OpenAI-Api-Key": OPENAI_API_KEY,
    },
)

client.collections.create(
    name="web_retrieval",
    description="Collection to store web retrieval results",
)
collection = client.collections.get(name="web_retrieval")

How can I retrieve the collection’s description?

If there is no way then how could I store and retrieve metadata related to a collection.

you can use

    config = collection.config.get(True)
    print(config.description)
1 Like