Hi All, Does anyone know how I could import a set ...
# general
p
Hi All, Does anyone know how I could import a set of modules but have them underneath a namespace? (the aim is allow engineres to explore/autocomplete a bit easier from within jupyter notebooks)
Copy code
import ourlib.modules as mod
my_modules = [mod.load_csv, mod.compute1, mod.compute2, mod_save_csv]

dr = driver.Builder()
           .with_modules(*my_modules)
           .with_config(my_config)
# where file system is strutured - ourlib - modules - load_csv.py - compute1.py - compute2.py - save_csv.py
s
Interesting. Two questions: 1. Where would you like the autocomplete to occur? 2. What do you mean by namespace? Is that to prevent some sort of clashing? or?
p
Hi Stefan, I'll try the google meet in a sec. But still to answer here. I was thinking auto complete in jupyter notebooks and IDE so someone could type. mod. and it would show all the modules avaliable I think namesapce I probably mean python pacakge. Usage is a container for modules, where someone could auto complete a module name.
s
so to close the loop here, you can create a python module (e.g.
X
), and in the
___init___.py
import them so that you can reference those modules you want to group under it (e.g.
<http://X.my|X.my>_module
).
👍 1