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.

datadevops
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.

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 footguns
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.
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.
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.
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.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
22 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
bytedance
4
dotbot
1
script
1
Resources