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
Built Distribution
Close
Hashes for databricks-sql-connector-2.0.0b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44e62e8f8bbabed912d80acfbf1eee252f8bc4f3a88ef369e998d7f9b8069d18 |
|
MD5 | b6fe88a940ba1c9d8678a99b277564f6 |
|
BLAKE2b-256 | e8f52fc752b821c6ae20b1a7fed889f5baadb5350f76507d8c4c273cf30b7d72 |
Close
Hashes for databricks_sql_connector-2.0.0b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28add96d58a6c7ee8453ea0ffef9bf9d0109612994dab40c8a0856c78d1bebca |
|
MD5 | 09d63663b8404e974051677306972480 |
|
BLAKE2b-256 | 9d3e6f1a7799ccc0ab2039f8a2e5e4634143f4d882462bd80d4ca6cd431e3e1d |