Registry / type-stubs / dbutils-typehint

dbutils-typehint

JSON →
library0.1.9pypypi✓ verified 84d ago

Provides type hints for Databricks DBUtils (dbutils), enabling IDE autocompletion and static type checking. Version 0.1.9, maintained as a stub-type package with periodic updates to match Databricks runtime changes.

pip install dbutils-typehint
INSTALL
IMPORT
SIG · DBUTILS-TYPEHINT
D
dbutils-typehint
type-stubspythonv0.1.9
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dbutils_typehint
import dbutils_typehint
from dbutils import typehint
The package is imported as a module, not a subpackage of dbutils.

Import the module to activate type hints for dbutils. No direct usage required; the module patches dbutils objects at import time.

import dbutils_typehint from typing import Optional # Use dbutils in a typable way dbutils.fs.ls('/mnt/data') # Now has type hints enabled # Explicitly annotate if needed result: Optional[list] = dbutils.fs.ls('/tmp')
Debug
Known issues
deprecatedThis package is effectively unmaintained; last release 2022. Use 'dbutils-stubs' or 'databricks-sdk' for newer Databricks runtimes.
fix
Switch to 'pip install dbutils-stubs' for Databricks Runtime 10+.
affects: >=0.1.9
gotchaImport order matters: must import 'dbutils_typehint' BEFORE any use of dbutils. Otherwise type hints won't activate.
fix
Place 'import dbutils_typehint' at the very top of your script, before other imports that use dbutils.
affects: all
gotchaThe package relies on monkey-patching and may not work with some IDEs or static type checkers (e.g., Pyright) that enforce strict import restrictions.
fix
Consider using 'databricks-connect' or the official Databricks SDK for better type support.
affects: all
Errors
Common errors & fixes
AttributeError: module 'dbutils' has no attribute 'fs'
dbutils not available in local environment; this package only provides type hints, not runtime implementation.
fix
Run code only in Databricks environment. For local testing, use 'databricks-connect' or mock dbutils.
ImportError: cannot import name 'dbutils_typehint' from 'dbutils'
Incorrect import path: attempting to import from 'dbutils' instead of the top-level package.
fix
Use 'import dbutils_typehint' (not 'from dbutils import ...').
Upgrade
Version history
0.1.9latest on PyPI · released Aug 4, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
dbutils-typehint — pip install dbutils-typehint · libregistry