Creating a new project¶
We recommend that you create projects according to the Kedro default project template, which is ideal for analytics projects and comes with a default folder structure for storing datasets, folders for notebooks, configuration and source code.
Projects can be created interactively or by referencing a configuration file.
You can also work with a Kedro project that has already been created. In this case, you don’t need to create a new Kedro project, but can use
git cloneto clone the existing project.
Create a new project interactively¶
First, select the directory in which you want to work, and if you are using
conda, make sure you have the correct environment activated:
conda activate environment_name
You are then ready to create a new project.
kedro new to create a new project in your current working directory (
You will need to provide the following variables:
project_name- A human readable name for your new project
repo_name- A name for the directory that holds your project repository
python_package- A Python package name for your project package (see Python package naming conventions)
include_example- Confirms or rejects the inclusion of example code. If you enter
Yto include an example then your new project template contains a small example to get you going. See the Hello World example for further details
Create a new project from a configuration file¶
You can also create a new project from a configuration file by running:
kedro new --config config.yml
The configuration file (
config.yml) must contain the
include_example (Boolean value) variables as described above as well as
output_dir - path to the directory where the project folder will be created.
Here is an example
config.yml, which assumes that a directory named
~/code already exists:
output_dir: ~/code project_name: Getting Started repo_name: getting-started python_package: getting_started include_example: true
output_dir can be set to
~ for home directory, or
. for the current working directory.
Create a new project using starters¶
Kedro supports using custom starter templates to create your project via the
--starter flag. To learn more about this feature, please read the guide to creating new projects with Kedro Starters.
Working with your new project¶
Having created a new project, you may want to set up a new
git repository by calling:
Amend project-specific dependencies¶
Once you have created a new project, you can update its dependencies. The generic project template bundles some typical dependencies, in
On the first use of your project, if you want to add or remove dependencies, edit
Then run the following:
build-reqs command will:
src/requirements.infrom the contents of
pip-compilethe requirements listed in
src/requirements.txtto specify a list of pinned project dependencies (those with a strict version).
src/requirements.incontains “source” requirements, while
src/requirements.txtcontains the compiled version of those and requires no manual updates. To further update the project requirements, you should modify
src/requirements.txt) and re-run
If your project has
conda dependencies, you can create a
src/environment.yml file and list them there.
To install the project-specific dependencies, run the following command:
kedro installautomatically compiles project dependencies by running
kedro build-reqsbehind the scenes before the installation if the
src/requirements.infile doesn’t exist. To skip the compilation step and install requirements as-is, run
kedro install --no-build-reqs. To force the compilation even if
kedro install --build-reqs.