databricks-dbapi
A DBAPI 2.0 interface and SQLAlchemy dialect for Databricks interactive clusters.
What it is and what it does
databricks-dbapi is a thin wrapper around pyhive and pyodbc that implements the Python DBAPI 2.0 standard for connecting to Databricks clusters. It lets you execute SQL queries against Databricks Workspace and SQL Analytics clusters using either a Thrift-based connection (via pyhive) or an ODBC connection (via pyodbc with the Simba driver). The package also registers SQLAlchemy dialects so you can use Databricks as a backend with SQLAlchemy's ORM and query builder.
The main use case is integrating Databricks query execution into Python applications that expect a standard DBAPI interface or SQLAlchemy support. It handles authentication via Databricks tokens and cluster endpoints, and supports both synchronous queries and asynchronous polling for long-running operations. However, the package has been abandoned since January 2022 and receives no maintenance, so compatibility with recent Databricks API changes or authentication schemes is uncertain.
Use it for:
- Execute SQL queries against Databricks clusters from Python scripts using standard DBAPI cursor methods.
- Integrate Databricks as a SQLAlchemy backend for ORM-based data access in Python applications.
- Run asynchronous queries on Databricks clusters and poll for results without blocking.
- Connect to SQL Analytics clusters via ODBC when pyhive is not suitable or available.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a DBAPI 2.0 connection interface and SQLAlchemy dialects to query Databricks Workspace and SQL Analytics clusters using either pyhive or pyodbc backends.
No, not recommended for new projects. The package is abandoned (last release November 2021, last commit January 2022) and receives no maintenance. Databricks likely provides official or better-maintained connectors; you should check the current Databricks documentation for supported Python drivers before choosing this package. If you have legacy code already using it, it may still work, but migration to an actively maintained alternative is advisable.
Install
databricks-dbapi on PyPI
pip
pip install databricks-dbapiuv
uv add databricks-dbapipoetry
poetry add databricks-dbapiInstalling databricks-dbapi
Before you install
Installation is low-friction as a pure-Python wheel, but the package is abandoned as of January 2022 with no recent maintenance. You must explicitly install at least one extra (hive or odbc), and the odbc path requires the separate Simba ODBC driver to be installed on your system.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.
Quickstart
pip install databricks-dbapi[hive]
from databricks_dbapi import hive
import os
connection = hive.connect(
host=os.environ["DATABRICKS_HOST"],
http_path=os.environ["DATABRICKS_HTTP_PATH"],
token=os.environ["DATABRICKS_TOKEN"]
)
cursor = connection.cursor()
cursor.execute("SELECT * FROM some_table LIMIT 100")
print(cursor.fetchone())
For odbc mode, the Simba ODBC driver must be installed separately on your system; for hive mode, pyhive and thrift are required as optional dependencies.
Verify before relying
- Whether pyhive and pyodbc are declared as optional dependencies in the package metadata (not shown in fact sheet).
- Current compatibility with modern Databricks APIs and authentication methods beyond token-based auth.
- Whether the abandoned status affects functionality with current Databricks cluster versions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,726 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 147,461/month — #11,065 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: databricks_dbapi-0.6.0-py2.py3-none-any.whl
Keywords: databricks, hive, dbapi, sqlalchemy, dialect
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
elasticsearch-dbapiProvides DBAPI (PEP-249) and SQLAlchemy dialect…
permissive · top 5,000 on PyPI
PyHivePyHive provides DB-API and SQLAlchemy…
permissive · top 5,000 on PyPI
sqlalchemy-databricksProvides a SQLAlchemy dialect that connects to…
permissive · top 15,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
ydb-dbapiA Python DBAPI driver for YDB that provides…
unclear · top 5,000 on PyPI
databricks-sqlalchemyProvides a SQLAlchemy 2.0 dialect that bridges…
permissive · top 1,000 on PyPI
dbapiCommand-line client for interacting with Douban…
permissive · top 15,000 on PyPI
pydynamodbPyDynamoDB is a DB API 2.0 client for Amazon…
permissive · top 15,000 on PyPI
trinoPython client library for Trino, a distributed…
permissive · top 1,000 on PyPI
sqlalchemy-jdbcapiSQLAlchemy dialect for JDBC and ODBC database…
permissive · top 15,000 on PyPI