Skip to main content

Databricks SQL Connector for Python

Project description

Databricks SQL Connector for Python

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)

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

This version

0.9.0

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-0.9.0.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

databricks_sql_connector-0.9.0-2-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: databricks-sql-connector-0.9.0.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for databricks-sql-connector-0.9.0.tar.gz
Algorithm Hash digest
SHA256 906e2e3e81501148441db5ce12a42de49ed809cba67558b59ddc38e44b5827c3
MD5 e3f9ff294535f073a45cca4e1daf6434
BLAKE2b-256 6185a66cc1903a63d6ec2421c99c7a0b0efa7e58a330efa417ae8cde12af9a5e

See more details on using hashes here.

File details

Details for the file databricks_sql_connector-0.9.0-2-py3-none-any.whl.

File metadata

  • Download URL: databricks_sql_connector-0.9.0-2-py3-none-any.whl
  • Upload date:
  • Size: 36.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for databricks_sql_connector-0.9.0-2-py3-none-any.whl
Algorithm Hash digest
SHA256 23636b0adac808f4f0847a8d199783459011c6acd0feb5c2cd8e87d505724f66
MD5 6e0bc139c1240003c097b73d36b7d5c1
BLAKE2b-256 8fd6a5590625e7d24544031b4a445d36e8a8458285beba48f9f4318737387794

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