Skip to content

Example on how to modularize Python packages in Databricks.

Notifications You must be signed in to change notification settings

jacovg91/modularizing-python-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookie cutter template for using your own Python modules inside Databricks notebooks

Steps to follow:

  • Move the .py files containing the functions into a seperate directory.
  • Create an empty file called __init__.py in the same directory. This way Python knows it is a package directory.
  • In your notebook, add the following:
import sys
sys.path.append("path/to/my_folder")
  • Then import functions the following way:
from <my_library>.<my_module> import <function_name>, <ClassName>

image

About

Example on how to modularize Python packages in Databricks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published