SQLAlchemy Dialect for Databricks
Project description
sqlalchemy-databricks
A SQLAlchemy Dialect for Databricks using the officially supported databricks-sql-connector
dbapi. Compatible with workspace and sql analytics clusters. (Thanks to @Tom-Newton for pointing this out)
Installation
Install using pip.
pip install sqlalchemy-databricks
Usage
Installing registers the databricks+connector
dialect/driver with SQLAlchemy. Fill in the required information when passing the engine URL. The http path can be for either a workspace or sql analytics cluster.
from sqlalchemy import *
from sqlalchemy.engine import create_engine
engine = create_engine(
"databricks+connector://token:<databricks_token>@<databricks_host>:443/default",
connect_args={"http_path": "<cluster_http_path>"}
)
logs = Table("my_table", MetaData(bind=engine), autoload=True)
print(select([func.count("*")], from_obj=logs).scalar())
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 sqlalchemy-databricks-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5054f3e7e023864efda9f4b5c363823bf94c72ac123afebe2ff7a84457dcccd2 |
|
MD5 | 5ad2cee662d4a7235a0171ca58a5684b |
|
BLAKE2b-256 | 15a1a9ac4427058ea9e65136ccfac26cafc6eb384dd159c2f01fa9d104391846 |
Close
Hashes for sqlalchemy_databricks-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 972dbb43b430ea5e47444373734123e50ea80e1e224b8157d05a0fa58c6d6775 |
|
MD5 | e71e36d2f8aaa0e0602acbd2c07b16c4 |
|
BLAKE2b-256 | 0ef082102dc94720d93ed8dbcac826575d60fb0a9b304511038482cc6a1fa10c |