Skip to main content

Creating a project with components

warning

This feature is considered in a preview stage and is under active development. It can change significantly, or be removed completely. It is not considered ready for production use.

After installing dependencies, you can scaffold a components-ready project. In the example below, we scaffold a project called jaffle-platform:

dg scaffold project jaffle-platform
Creating a Dagster project at /.../jaffle-platform.
Scaffolded files for Dagster project at /.../jaffle-platform.
...

This command builds a project and initializes a new Python virtual environment inside of it. When using dg's default environment management behavior, you won't need to worry about activating this virtual environment yourself.

note

To create and manage multiple components-ready projects, see "Managing multiple projects with dg". Each project will have its own uv-managed Python environment.

Project structure

Running dg scaffold project <project-name> creates a fairly standard Python project structure:

cd jaffle-platform && tree
.
├── jaffle_platform
│   ├── __init__.py
│   ├── definitions.py
│   ├── defs
│   │   └── __init__.py
│   └── lib
│   └── __init__.py
├── jaffle_platform.egg-info
│   ├── PKG-INFO
│   ├── SOURCES.txt
│   ├── dependency_links.txt
│   ├── entry_points.txt
│   ├── requires.txt
│   └── top_level.txt
├── jaffle_platform_tests
│   └── __init__.py
├── pyproject.toml
└── uv.lock

6 directories, 13 files

The following files and directories are included:

  • A Python package jaffle_platform-- the name is an underscored inflection of the project root directory (jaffle_platform).
  • An (empty) jaffle_platform_tests test package.
  • A uv.lock file.
  • A pyproject.toml file.
note

For more information about the sections and settings in pyproject.toml, see "pyproject.toml settings".

Next steps

After scaffolding your project with components, you can add more components to complete your pipeline.