https://kedro.org/ logo
#questions
Title
# questions
g

George p

12/12/2023, 2:06 PM
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

Juan Luis

12/12/2023, 2:09 PM
welcome @George p! what about
Copy code
ā”œā”€ā”€ src
ā”‚   ā””ā”€ā”€ tmp_spaceflights
ā”‚       ā”œā”€ā”€ __init__.py
ā”‚       ā”œā”€ā”€ __main__.py
ā”‚       ā”œā”€ā”€ lib              # <--- Here!
ā”‚       ā”‚   ā””ā”€ā”€ __init__.py
g

George p

12/12/2023, 2:13 PM
Thanks! And what would be the best way to import it in a test notebook (with a loaded catalog) ?
d

datajoely

12/12/2023, 2:13 PM
kedro jupyter notebook
g

George p

12/12/2023, 2:15 PM
Sorry, i meant "import"
j

Juan Luis

12/12/2023, 2:28 PM
Copy code
from tmp_spaceflights.lib import my_function
but for that to work you'd need to first do
pip install -e .
g

George p

12/12/2023, 4:27 PM
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

Juan Luis

12/12/2023, 6:47 PM
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
10 Views