Databricks SQL Connector for Python
Actively maintained. Last release 6 days ago, commits in 23 of the last 26 weeks. A safe choice.
pip install databricks-sql-connectorDatabricks SQL Connector for Python
The Databricks SQL Connector for Python allows you to develop Python applications that connect to Databricks clusters and SQL warehouses. It is a Thrift-based client with no dependencies on ODBC or JDBC. It conforms to the Python DB API 2.0 specification.
This connector uses Arrow as the data-exchange format, and supports APIs (e.g. fetchmany_arrow) to directly fetch Arrow tables. Arrow tables are wrapped in the ArrowQueue class to provide a natural API to get several rows at a time. PyArrow is required to enable this and use these APIs, you can install it via pip install pyarrow or pip install databricks-sql-connector[pyarrow].
The connector includes built-in support for HTTP/HTTPS proxy servers with multiple authentication methods including basic authentication and Kerberos/Negotiate authentication. See docs/proxy.md and examples/proxy_authentication.py for details.
You are welcome to file an issue here for general use cases. You can also contact Databricks Support here.
Requirements
Python 3.9 or above is required.
Documentation
For the latest documentation, see
For a full reference of every sql.connect(...) keyword argument — type,
default, per-backend support (Thrift vs Kernel), and meaning — see
CONNECTION_PARAMETERS.md.
Quickstart
Installing the core library
Install using pip install databricks-sql-connector