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

Alicia Yen

02/08/2024, 10:56 PM
Hello, I am trying to integrate Kedro with our company's folder structure. Is it possible to remove
<package_name>
from the
src
folder? i.e. the following tree
Copy code
.
├── README.md
├── conf
│   ├── ...
├── data
│   ├── ...
├── pyproject.toml
└── src
    ├── ...
    ├── pipelines
n

Nok Lam Chan

02/08/2024, 11:30 PM
I think you may want to move everything out from src to the root instead of removing package name
You still need it because the import is gonna be from package name.a.b.c
a

Alicia Yen

02/08/2024, 11:41 PM
Hi Nok, thanks for your reply. The link you provided is different from what I want to achieve. I want to keep
src
but remove the package name directory. For example, I currently have the following structure in my test project:
Copy code
.
├── README.md
├── conf
│   ├── ...
├── data
│   ├── ...
├── pyproject.toml
└── iris
    ├── ...
    ├── pipelines
and in the
pyproject.toml
I modified
source_dir = "."
so the current set up works as is. What I would like to achieve is to rename
iris
to
src
. Is this possible?
j

Juan Luis

02/09/2024, 7:18 AM
@Alicia Yen you can do it, but then you’d need to import your code as
from src.pipelines import …
is that what you want?
a

Alicia Yen

02/09/2024, 3:30 PM
@Juan Luis - Yes, that is what I want. What else do I need to change in the
pyrproject.toml
to make this change? Thanks for your help
j

Juan Luis

02/09/2024, 4:28 PM
after you've done
source_dir = ""
, try replacing
<package_name>
with
src
in
pyproject.toml
, for example in
[project].name
,
[tool.kedro].package_name
, and possibly others
thankyou 1
2 Views