Hey All! Very new (and excited) user of kedro here...
# questions
g
Hey All! Very new (and excited) user of kedro here! Hopefully i can help with some of the questions myself, in the future. Could you perhaps suggest the best location to add a library of functions i have, in order to use it for my project?
K 1
šŸš€ 1
j
welcome @George p! what about
Copy code
ā”œā”€ā”€ src
ā”‚   ā””ā”€ā”€ tmp_spaceflights
ā”‚       ā”œā”€ā”€ __init__.py
ā”‚       ā”œā”€ā”€ __main__.py
ā”‚       ā”œā”€ā”€ lib              # <--- Here!
ā”‚       ā”‚   ā””ā”€ā”€ __init__.py
g
Thanks! And what would be the best way to import it in a test notebook (with a loaded catalog) ?
d
kedro jupyter notebook
g
Sorry, i meant "import"
j
Copy code
from tmp_spaceflights.lib import my_function
but for that to work you'd need to first do
pip install -e .
g
Unfortunately that is not clear at all. Do you have any relevant documentation? I tried the pip install command and it created an UNKNOWN.egg-info file, and then my notebook doesnt recognise the (equivalent for me)
lib
module
In general, i struggle to find any documentation on how to place/use/import custom libraries with kedro
j
hi @George p, good point - projects created with Kedro<0.19 have 2 metadata files. you will probably need
pip install -e ./src
instead (otherwise you get the
UNKNOWN.egg-info
file you mention). please try it out
In general, i struggle to find any documentation on how to place/use/import custom libraries with kedro
I just opened an issue https://github.com/kedro-org/kedro/issues/3418