{"id":4311,"library":"unitycatalog-client","title":"Unity Catalog Client","description":"The `unitycatalog-client` is the official Python SDK for interacting with Databricks Unity Catalog APIs. It provides programmatic access to manage catalogs, schemas, tables, volumes, and other Unity Catalog assets. Currently at version 0.4.1, it receives frequent updates, often with multiple releases per month, reflecting ongoing development and new feature integration.","status":"active","version":"0.4.1","language":"en","source_language":"en","source_url":"https://github.com/databricks/unity-catalog-client","tags":["databricks","unity catalog","api client","data governance","cloud"],"install":[{"cmd":"pip install unitycatalog-client","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Used for data model validation and parsing API responses.","package":"pydantic"},{"reason":"For making HTTP requests to the Unity Catalog API.","package":"requests"}],"imports":[{"symbol":"UnityCatalogClient","correct":"from unitycatalog_client import UnityCatalogClient"}],"quickstart":{"code":"import os\nfrom unitycatalog_client import UnityCatalogClient\n\n# To run this code, set the following environment variables:\n# os.environ['DATABRICKS_HOST'] = 'https://<your-databricks-host>'\n# os.environ['DATABRICKS_TOKEN'] = 'dapi...' # A Databricks personal access token\n\ntry:\n    # The client automatically picks up DATABRICKS_HOST and DATABRICKS_TOKEN\n    # from environment variables if not provided explicitly.\n    client = UnityCatalogClient()\n\n    print(\"Attempting to list catalogs in Unity Catalog...\")\n    catalogs = client.list_catalogs()\n\n    if catalogs:\n        print(f\"Successfully retrieved {len(catalogs)} catalogs:\")\n        for catalog in catalogs:\n            print(f\"- Name: {catalog.name}, Full Name: {catalog.full_name}\")\n    else:\n        print(\"No catalogs found or accessible.\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure DATABRICKS_HOST and DATABRICKS_TOKEN environment variables are set and valid,\")\n    print(\"and that your token has permissions to list catalogs.\")","lang":"python","description":"This quickstart demonstrates how to initialize the `UnityCatalogClient` and list all available catalogs. It relies on `DATABRICKS_HOST` and `DATABRICKS_TOKEN` environment variables for authentication, which must be set for the client to connect successfully."},"warnings":[{"fix":"Refer to the GitHub release notes and official documentation when upgrading to a new version, and thoroughly test your integrations.","message":"As the library is pre-1.0 (currently v0.4.1), its API surface, including method signatures, return types, and available models, may change in minor or even patch releases without strictly adhering to semantic versioning for breaking changes.","severity":"breaking","affected_versions":"All versions < 1.0.0"},{"fix":"Ensure `DATABRICKS_HOST` (e.g., `https://workspace.cloud.databricks.com`) and `DATABRICKS_TOKEN` (a Databricks personal access token) are correctly configured in your environment or passed explicitly during client instantiation.","message":"Authentication requires `DATABRICKS_HOST` and `DATABRICKS_TOKEN` to be set as environment variables or passed directly to the `UnityCatalogClient` constructor. Incorrect or missing credentials will result in authentication failures.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To use existing `databricks-sdk` authentication, instantiate the client like this: `from databricks.sdk import WorkspaceClient; from unitycatalog_client import UnityCatalogClient; client = UnityCatalogClient(api_client=WorkspaceClient().api_client)`.","message":"When operating within a Databricks environment (e.g., notebooks, jobs) or if you are already using `databricks-sdk`, you can leverage its authentication context to instantiate `UnityCatalogClient`. Not knowing this integration path can lead to redundant credential management.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}