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
databricks-sql-connector-2.0.2.tar.gz
(193.9 kB
view hashes)
Built Distribution
Close
Hashes for databricks-sql-connector-2.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b74bb176571ba6107c3610b04ec875bf52951c50e515bea8abb2ffb8fe4c90d7 |
|
MD5 | 0028cc39527a48822e3ae702301f534c |
|
BLAKE2b-256 | 210e7875ef5ccd1e22a853c49dae92e789193e46b320d8804eac27deae58172a |
Close
Hashes for databricks_sql_connector-2.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480f299d2a9f950da4f7a12a5a1dd51789af588c133f237a1878b7a4d506bad8 |
|
MD5 | d93fc8d0363e901477dfa09753c440ca |
|
BLAKE2b-256 | 8cb0bc53f399ba0d34239c9e29ef2a9fbb9d4385ee24159b30e98bdef6002e3d |