Databricks dbutils-compatible adapter for local and Databricks runtimes.
Project description
bd-utils
bd-utils provides a dbutils-like interface that works in both Databricks and local environments.
Goals
- Use native Databricks
dbutilswhen running on Databricks. - Use a predictable local implementation for tests and local scripts.
- Keep unsupported APIs explicit with actionable errors.
API compatibility target
bdutils mirrors the Databricks module layout:
credentials,data,fs,jobs.taskValues,library,meta,notebook,preview,secrets,widgets,api
Locally, commonly used commands are implemented (widgets, secrets, fs, jobs.taskValues, notebook.exit); unsupported commands are present and raise NotImplementedError.
Quick start
import bdutils
value = bdutils.widgets.get("country")
Alternative (useful in tests when you need explicit config):
from bdutils import get_dbutils
dbutils = get_dbutils(force_adapter="local")
print(dbutils.fs.help("ls"))
Run tests
make test
This runs:
PYTHONPATH=src python -m pytest -q tests
Local widget lookup order
- Values set with
widgets.text(...)in-process - Environment variable
DBX_WIDGET_<NAME_UPPER_SNAKE>
Local secret mapping
dbutils.secrets.get(scope, key) maps to environment variable:
DBX_SECRET__<SCOPE>__<KEY>
Notes
dbfs:/...paths are mapped to~/.bd-utils/dbfs/...by default.- Unsupported methods raise
NotImplementedError.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bd_utils-0.1.1.tar.gz.
File metadata
- Download URL: bd_utils-0.1.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
090bebb7d03345680efb0265339246e2e54f98439da07eaaf90fe831e9f8063f
|
|
| MD5 |
2fc9afcb4ac5eeffb3919565a4119a87
|
|
| BLAKE2b-256 |
e0ba6f9758d062534e21ec73f443c90c8ade3d01fcb2dca2e438ae2c07a0b970
|
Provenance
The following attestation bundles were made for bd_utils-0.1.1.tar.gz:
Publisher:
pypi-publish.yml on josefondrej/bd-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bd_utils-0.1.1.tar.gz -
Subject digest:
090bebb7d03345680efb0265339246e2e54f98439da07eaaf90fe831e9f8063f - Sigstore transparency entry: 1485496277
- Sigstore integration time:
-
Permalink:
josefondrej/bd-utils@06bb3f7bac5b63bc9af0462d5cdbfc78a1bb08f4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/josefondrej
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@06bb3f7bac5b63bc9af0462d5cdbfc78a1bb08f4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bd_utils-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bd_utils-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3048a8b146ccbdb3e94a133ab2e456e18598de27f355e1805f958daa2784f36
|
|
| MD5 |
0bed068cb0e79824bb64440e241db7c2
|
|
| BLAKE2b-256 |
9d344e5a377c3d433fdd3db13c752abe7874b5e63361292dafac9568868f7abb
|
Provenance
The following attestation bundles were made for bd_utils-0.1.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on josefondrej/bd-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bd_utils-0.1.1-py3-none-any.whl -
Subject digest:
d3048a8b146ccbdb3e94a133ab2e456e18598de27f355e1805f958daa2784f36 - Sigstore transparency entry: 1485496325
- Sigstore integration time:
-
Permalink:
josefondrej/bd-utils@06bb3f7bac5b63bc9af0462d5cdbfc78a1bb08f4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/josefondrej
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@06bb3f7bac5b63bc9af0462d5cdbfc78a1bb08f4 -
Trigger Event:
release
-
Statement type: