skillfed

databricks-dbapi

A DBAPI 2.0 interface and SQLAlchemy dialect for Databricks interactive clusters.

databricks-dbapi v0.6.0 147.5K downloads/30d#11,065 on PyPI22
Permissive license MIT Abandoned released

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-dbapi

uv

uv add databricks-dbapi

poetry

poetry add databricks-dbapi

Installing 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

License :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: DatabaseTopic :: Database :: Front-Ends

Tags

databricks sql connectiondbapi databrickssqlalchemy databricks dialectdatabricks cluster querypyhive odbc wrapperdatabricks hive connectiondatabricks analytics driver
abandoneddbapi-connectorsqlalchemy-dialect

More Database packages