Skip to main content

SQLAlchemy Dialect for Databricks

Project description

sqlalchemy-databricks

pypi pyversions

A SQLAlchemy Dialect for Databricks workspace and sql analytics clusters using the officially supported databricks-sql-connector dbapi.

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/<database_or_schema_name>",
    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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlalchemy-databricks-0.2.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

sqlalchemy_databricks-0.2.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file sqlalchemy-databricks-0.2.0.tar.gz.

File metadata

  • Download URL: sqlalchemy-databricks-0.2.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.8.2 Darwin/20.1.0

File hashes

Hashes for sqlalchemy-databricks-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d6efc02643962a1841eeb9139b942efc0246440c9cef3e7f7ebb3ea8d38eb5c0
MD5 90787037dc068e5d01f139fa6dff175e
BLAKE2b-256 354de83a8fb0203b2e8747b247b3e839cfe591caf3855c038009065bbe755b29

See more details on using hashes here.

File details

Details for the file sqlalchemy_databricks-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_databricks-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0c34e85727c289f742c258ce236fe7c95bcc4bcc3a2872b724cc2da20f4db8c
MD5 6b5e49ecada3f5a4fa4ce33ead03faa2
BLAKE2b-256 2849bdfb7e9d2a6de4b9fd20a90442a00c9bf4109bbb09e9a5a68c86e98babb0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page