Skip to main content

dbx-tools-core

Dependency-free Python configuration and identity helpers shared by dbx-tools packages.

Install from PyPI:

pip install dbx-tools-core

To install the current main branch directly from the repository instead:

pip install "dbx-tools-core @ git+https://github.com/reggie-db/dbx-tools.git@main#subdirectory=packages/py/core"

Key features

  • config.text() resolves scoped keys from constant data, the process environment, the nearest project .env file, the single App's config.env in validated Databricks bundle JSON, then app.yaml / app.yml env values. Root bundle variables are not a config source: they are authoring inputs interpolated into the bundle's own targets, resources, and paths, so reading one as a process setting resolves names the deployed App never sees. Reference a variable from config.env to make it one.
  • .env.<NODE_ENV> wins over .env, with production/prod and development/dev treated as aliases.
  • Bundle validation stays lazy: the Databricks CLI runs only after environment and dotenv lookup miss; app YAML runs only after bundle lookup misses. Parsed dotenv records are cached by file path, bundle output by bundle path plus Databricks profile, and app YAML by app path. Bundle value_from and App YAML valueFrom references resolve supported values from named resources. Config-file discovery and parsed results are single-attempt per source key: found paths, missing files, empty records, invalid records, and None results all cache.
  • Deployed Databricks Apps skip local files and bundle validation because the platform has already populated real environment variables.
  • DBX_TOOLS_DATABRICKS_APP_ENV=true or false forces Databricks App runtime detection; absent or unrecognized values retain automatic detection.
  • DBX_TOOLS_CONFIG_DOTENV, DBX_TOOLS_CONFIG_BUNDLE, and DBX_TOOLS_CONFIG_APP independently force each local source on or off, overriding the usual deployed-App skip.
  • Bundle reads default off when NODE_ENV=production unless DBX_TOOLS_CONFIG_BUNDLE=true explicitly enables them.
  • String, boolean, positive-number, positive-integer, and list helpers use the same loose configuration coercions as @dbx-tools/core.
  • Stable-key, FNV hash, and identifier functions preserve deterministic Node and Python identity contracts.

Quick start

from dbx_tools.core import config

host = config.text("HOST", {"prefix": "SMTP"})
port = config.positive_int(None, "PORT", 587, {"prefix": "SMTP"})
endpoint = config.resolve_value(
    "lakebaseEndpoint",
    {
        "data": {"LAKEBASE_ENDPOINT": flags.endpoint},
        "sources": ["env", "dotenv", "bundle", "app"],
    },
)

The default key order for HOST with prefix SMTP is DBX_TOOLS_SMTP_HOST, SMTP_HOST, then HOST. Pass config.ENV_ONLY when a caller must read the exact process environment without local file fallbacks. Constant data is first by default. If custom sources omit config, passed data is still read and appended last, as in the environment-first example. resolve_value() tries exact, uppercase, and tokenized-uppercase names through the same scope and prefix rules. config.is_databricks_app_env() validates the App name, HTTP(S) workspace host, and TCP port unless config.DATABRICKS_APP_ENV_KEY names a recognized boolean override in the environment. config.CONFIG_DOTENV_KEY, config.CONFIG_BUNDLE_KEY, and config.CONFIG_APP_KEY name the equivalent per-source overrides. Recognized booleans win; absent or unrecognized values read files outside a Databricks App and skip them inside one. Bundle validation also stays off by default in production.

Modules

  • config — layered environment, dotenv, Databricks bundle, and app YAML configuration;
  • hash.fnv_hash() — the single-string subset of TypeScript fnvHashWithOptions, including UTF-16 code-unit hashing and base-32 output;
  • object.to_stable_key() — strict structured identity canonicalization;
  • string.to_identifier() — readable identifier tokenization, with the same hyphen default as TypeScript and an explicit delimiter override for consumers such as the underscore-delimited Postgres bus channel.

The identity functions exist so Python packages do not copy the TypeScript algorithms locally and silently drift. Their shared behavior is tested from packages/test/polyglot/fixtures/core/fixture.json. Configuration precedence, dotenv discovery/parsing, bundle fallback, laziness, and parsed-record caching are shared fixtures under packages/test/polyglot/fixtures/core/config.

Download files

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

Source Distribution

dbx_tools_core-0.6.90.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

dbx_tools_core-0.6.90-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file dbx_tools_core-0.6.90.tar.gz.

File metadata

  • Download URL: dbx_tools_core-0.6.90.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dbx_tools_core-0.6.90.tar.gz
Algorithm Hash digest
SHA256 42046845a86c9420a41c36209c5c728c167d993e9f1d4536ded0114224f56a62
MD5 f49b7be1df3cae4bf3a7ef01641a5341
BLAKE2b-256 1dafdb3aa870b07c58aac83dc20a260c2f1870b14103132ffdf8ec6de60e2212

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbx_tools_core-0.6.90.tar.gz:

Publisher: python-release.yml on reggie-db/dbx-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbx_tools_core-0.6.90-py3-none-any.whl.

File metadata

File hashes

Hashes for dbx_tools_core-0.6.90-py3-none-any.whl
Algorithm Hash digest
SHA256 ba7c13745299697c02aa8b2541776a67a32b116e4f6ef357df2c0ff8974207ca
MD5 d650dbfbe2d3a541049252337e0f1b96
BLAKE2b-256 a7a488637659f96b3eb661f8a205ed8429291364dab6b2bca17ea2e34957160c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbx_tools_core-0.6.90-py3-none-any.whl:

Publisher: python-release.yml on reggie-db/dbx-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.201

2 files

0.6.200

2 files

0.6.199

2 files

0.6.198

2 files

0.6.197

2 files

0.6.196

2 files

0.6.195

2 files

0.6.194

2 files

0.6.193

2 files

0.6.192

2 files

0.6.191

2 files

0.6.188

2 files

0.6.186

2 files

0.6.185

2 files

0.6.183

2 files

0.6.182

2 files

0.6.181

2 files

0.6.180

2 files

0.6.179

2 files

0.6.177

2 files

0.6.176

2 files

0.6.175

2 files

0.6.174

2 files

0.6.173

2 files

0.6.172

2 files

0.6.171

2 files

0.6.170

2 files

0.6.168

2 files

0.6.163

2 files

0.6.161

2 files

0.6.160

2 files

0.6.158

2 files

0.6.153

2 files

0.6.147

2 files

0.6.146

2 files

0.6.145

2 files

0.6.144

2 files

0.6.143

2 files

0.6.142

2 files

0.6.141

2 files

0.6.140

2 files

0.6.139

2 files

0.6.138

2 files

0.6.137

2 files

0.6.136

2 files

0.6.135

2 files

0.6.134

2 files

0.6.133

2 files

0.6.131

2 files

0.6.130

2 files

0.6.129

2 files

0.6.128

2 files

0.6.127

2 files

0.6.126

2 files

0.6.125

2 files

0.6.124

2 files

0.6.123

2 files

0.6.122

2 files

0.6.121

2 files

0.6.120

2 files

0.6.119

2 files

0.6.118

2 files

0.6.117

2 files

0.6.116

2 files

0.6.115

2 files

0.6.114

2 files

0.6.113

2 files

0.6.112

2 files

0.6.111

2 files

0.6.110

2 files

0.6.109

2 files

0.6.108

2 files

0.6.107

2 files

0.6.106

2 files

0.6.105

2 files

0.6.104

2 files

0.6.103

2 files

0.6.102

2 files

0.6.101

2 files

0.6.100

2 files

0.6.99

2 files

0.6.98

2 files

0.6.97

2 files

0.6.96

2 files

0.6.95

2 files

0.6.94

2 files

0.6.93

2 files

0.6.92

2 files

0.6.91

2 files

This release

0.6.90 This release

2 files

0.6.89

2 files

0.6.88

2 files

0.6.87

2 files

0.6.86

2 files

0.6.85

2 files

0.6.82

2 files

0.6.78

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page