Databricks SQL Connector for Python
Project description
Databricks SQL Connector for Python
Status: Generally available
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
Built Distribution
Close
Hashes for databricks-sql-connector-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6a38ed9fe895d5f58f8605e6e725607954202b8d43cd207cdaa6c5bf4c3e580 |
|
MD5 | a9a5295eccfac55d7e5ed025791052ca |
|
BLAKE2b-256 | a993cbf23eb6fb5f76ee045cabc2ef17c08a621ad47cff568b2dca7084cb2bc6 |
Close
Hashes for databricks_sql_connector-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 504e797a9a0e6f912b098ffce7869ce7bd05cc18e5399ecfe03b7d8359b5dfdb |
|
MD5 | f29d174cacdec8f5b9a1b6b30e52ad05 |
|
BLAKE2b-256 | 7cb179cdfa1a23e993596c9b9ba2bc67ca600146fc9f4dc26fe8d865a11bdeb8 |