Skip to main content

Databricks SQL Connector for Python

Project description

Databricks SQL Connector for Python

Status: Private preview

Documentation can be found here: Databricks SQL Connector for Python.

About

The Databricks SQL Connector is a Python library that allows you to use Python code to run SQL commands on Databricks clusters and Databricks SQL endpoints. This library follows PEP 249 -- Python Database API Specification v2.0.

Quickstart

Install the library with pip install databricks-sql-connector

Example usage:

from databricks import sql

connection = sql.connect(
  server_hostname='<server-hostname>',
  http_path='<http-path>',
  access_token='<personal-access-token>')

cursor = connection.cursor()

cursor.execute('SELECT * FROM RANGE(10)')
result = cursor.fetchall()
for row in result:
  print(row)

cursor.close()
connection.close()

Where:

  • <server-hostname> is the Databricks instance host name.
  • <http-path> is the HTTP Path either to a Databricks SQL endpoint (e.g. /sql/1.0/endpoints/1234567890abcdef), or to a Databricks Runtime interactive cluster (e.g. /sql/protocolv1/o/1234567890123456/1234-123456-slid123)
  • <personal-access-token> is a HTTP Bearer access token, e.g. a Databricks Personal Access Token.

For more information, see Databricks documentation.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

databricks-sql-connector-2.0.1.tar.gz (193.5 kB view details)

Uploaded Source

Built Distribution

databricks_sql_connector-2.0.1-py3-none-any.whl (196.8 kB view details)

Uploaded Python 3

File details

Details for the file databricks-sql-connector-2.0.1.tar.gz.

File metadata

  • Download URL: databricks-sql-connector-2.0.1.tar.gz
  • Upload date:
  • Size: 193.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.6.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for databricks-sql-connector-2.0.1.tar.gz
Algorithm Hash digest
SHA256 5726db08484545e3670ad38210c0c33e7b3cc590c6b099e285781e7de404083f
MD5 a92f9b94612b8baf3dca7e1002c1d080
BLAKE2b-256 c36b856df2e520a550a91f02bea8aeee52a73c29ff45154ad77cbdeda975da44

See more details on using hashes here.

File details

Details for the file databricks_sql_connector-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: databricks_sql_connector-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 196.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.6.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for databricks_sql_connector-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9196e0617d6bf1fe12817f052355780ede2baefa49e79309647d6f9f14059972
MD5 4bcbc3096eea49f355b12e51478c4e40
BLAKE2b-256 ca64c94a005620ebb1a311dc3b6aa0f60126023c082bb96444cc4286e810b0e7

See more details on using hashes here.

Supported by

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