Skip to main content

A simple util to get a spark and mlflow session objects from an .env file

Project description

Databricks Session Util

A simple utility for spark and mlflow session objects

Setup

Quick Install

python -m pip install databricks_session

Build from source

Clone the repository

git clone https://github.com/Broomva/databricks_session.git

Install the package

cd databricks_session && make install

Build manually

After cloning, create a virtual environment

conda create -n databricks_session python=3.10
conda activate databricks_session

Install the requirements

pip install -r requirements.txt

Run the python installation

python setup.py install

Usage

The deployment requires a .env file created under local folder:

touch .env

It should have a schema like this:

databricks_experiment_name=''
databricks_experiment_id=''
databricks_host=''
databricks_token=''
databricks_username=''
databricks_password=''
databricks_cluster_id=''
import databricks_session 

# Create a Spark session
spark = DatabricksSparkSession().get_session()

# Connect to MLFLow Artifact Server
mlflow_session = DatabricksMLFlowSession().get_session()

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

databricks_session-0.1.11.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

databricks_session-0.1.11-py2.py3-none-any.whl (3.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file databricks_session-0.1.11.tar.gz.

File metadata

  • Download URL: databricks_session-0.1.11.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for databricks_session-0.1.11.tar.gz
Algorithm Hash digest
SHA256 886cd067db4ca4a311833a17370ad52e452109e8e32c1d7849906a934ff58f3e
MD5 99738943c4b5252c6ebf48e9e805fc0d
BLAKE2b-256 3144f16b08b0d8a891b695280492f0d08db27df34360e099ab169d2411df8b8c

See more details on using hashes here.

File details

Details for the file databricks_session-0.1.11-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for databricks_session-0.1.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bd070f70ef0036f03efed8326edaea07d1a94f57b7ca136ad1dcc68661ab0a81
MD5 0d76b20a9e50d165f5b57dccaf8ce6bf
BLAKE2b-256 7d252eea33b3f8317779bdf1f9e2d6c797dce875bcdccdfb92b9b98649e3696f

See more details on using hashes here.

Supported by

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