Registry / data / libify

libify

JSON →
library0.78pypypiunverified

Libify (version 0.78) is a Python library designed to simplify the process of importing Databricks notebooks as modules. It enables nesting of notebook imports for complex workflows and supports Databricks Runtime Version 5.5 and above. The library was last released in September 2020, indicating an infrequent release cadence and a focus on maintaining existing functionality rather than active development.

pip install libify
INSTALL
IMPORT
SIG · LIBIFY
L
libify
datapythonv0.78
Install
1.6s 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.78 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

libify
import libify
import libify

To use Libify, you need two types of notebooks: an 'importee' (the one providing functions) and an 'importer' (the one consuming them). The 'importee' notebook must end with a specific `libify.exporter` call to make its global scope available. The 'importer' notebook then uses `libify.importer` to load the target notebook as a module, allowing access to its defined functions and variables using dot notation.

# --- In the notebook to be imported (e.g., '/Users/my_user/my_functions') --- # This cell must be the LAST cell in the notebook and contain ONLY this code. def greet(name): return f"Hello, {name} from imported notebook!" def add(a, b): return a + b import libify libify.exporter(globals()) # --- In the importing notebook (e.g., '/Users/my_user/main_workflow') --- import libify # The path should be relative to the Databricks workspace root or absolute DBFS path my_module = libify.importer(globals(), '/Users/my_user/my_functions') # Now you can access functions/variables defined in 'my_functions' notebook message = my_module.greet("World") print(message) result = my_module.add(5, 3) print(f"The sum is: {result}") # Expected output in the importing notebook: # Hello, World from imported notebook! # The sum is: 8
Debug
Known issues
gotchaThe `dbutils.notebook.exit()` function must NOT be used in notebooks that are intended to be imported using `libify`. Its presence will prevent `libify` from properly exporting the notebook's global state.
fix
Remove any `dbutils.notebook.exit()` calls from 'importee' notebooks.
affects: All
gotchaThe `libify.exporter(globals())` call in the 'importee' notebook must be the absolute last cell and contain ONLY that specific code. Any other code or comments in that final cell will prevent correct module export.
fix
Ensure the last cell of the 'importee' notebook contains only `import libify; libify.exporter(globals())`.
affects: All
deprecatedDatabricks introduced 'Files in Repos' functionality (available since late 2021 / Feb 2023 update) which allows direct import of Python files as modules. This native feature might offer a more streamlined approach for new projects compared to `libify`, especially for standard Python modules.
fix
For new projects or refactoring, evaluate using Databricks 'Files in Repos' for native Python module imports instead of `libify`.
affects: < 0.78 (consider for new projects)
gotchaOn Databricks Community Cloud, the installation and setup for `libify` needs to be rerun each time a cluster is created or restarted for imports to function correctly.
fix
Include `libify` installation and the importer notebook's initial `import libify` as part of your cluster initialization scripts or rerun manually after restarts.
affects: All (specific to Databricks Community Cloud)
Upgrade
Version history
0.78latest on PyPI · released Sep 22, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Resources
libify — pip install libify · libregistry