Databricks with the Python SDK
Avi Steinberg
Senior Software Engineer
What is a Databricks Cluster?
Examples:

The Databricks SDK Clusters API allows you to create, start, edit, list and delete clusters
Let's walk through an example of listing the clusters created on a Databricks workspace
from databricks.sdk import WorkspaceClient w = WorkspaceClient()clusters = w.clusters.list() for cluster in clusters: print(f"ClusterId={cluster.cluster_id}")
ClusterId=0113-13328-woj98c32
What is a Databricks job?
The Jobs API allows you to create, edit, and delete jobs
Use the .list() method to list the jobs in the authenticated user's Workspace
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
c = w.jobs.list()
for job in jobs:
print(f"JobId={job.job_id}")
JobId=888763141802192
JobId=37050453972815
JobId=681550316180975
JobId=629994089852037
The resources for a workspace can be visualized online at https://<workspace-deployment-name>.cloud.databricks.com

Run Python code in Databricks Notebook

Databricks with the Python SDK