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.0.tar.gz
(193.5 kB
view hashes)
Built Distribution
Close
Hashes for databricks-sql-connector-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34e73309751932667157318404866cd47d939124ba79accf03ccc23bd8dc90ca |
|
MD5 | d9c6c83b9e418d711fdcf70a87ed7d0f |
|
BLAKE2b-256 | 23892e849caac07f2fc99d4f90598310d4f401a038bf26a64d187ec715ea89ba |
Close
Hashes for databricks_sql_connector-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b37b62b86b9091487238f76381b2eae010c2de31cc6cd74b53c56fed6d07842 |
|
MD5 | 3cf7b8c1818a7392d8e2ac567fb6c603 |
|
BLAKE2b-256 | c2b5cb4b3db4e7bf9f6ef81488d1f840b57b3050eb5969482afbcd520a33c8eb |