Creating a components-ready Dagster project
dg and Dagster Components are under active development. You may encounter feature gaps, and the APIs may change. To report issues or give feedback, please join the #dg-components channel in the Dagster Community Slack.
The create-dagster CLI allows you to create a special type of Python package, called a project, that defines a Dagster code location.
Prerequisites
Before creating a project, you must install create-dagster. If you're using uv, you can run create-dagster using uvx, without needing to install it first.
Creating a project
- uv
- Homebrew, curl, or pip
uvx -U create-dagster project my-project
create-dagster project my-project
Project structure
The create-dagster project command creates a directory with a standard Python package structure with some additions:
- uv
- pip
tree
.
├── pyproject.toml
├── src
│ └── jaffle_platform
│ ├── __init__.py
│ └── defs
│ └── __init__.py
├── tests
│ └── __init__.py
└── uv.lock
5 directories, 5 files
tree
.
├── pyproject.toml
├── src
│ └── jaffle_platform
│ ├── __init__.py
│ └── defs
│ └── __init__.py
└── tests
└── __init__.py
5 directories, 4 files
To use tree, install it with brew install tree (Mac), or follow the installation instructions.
- The Python package
my_projectlives insrc/my_projectand contains the deployable code that defines your Dagster pipelines. my_project/defswill contain your Dagster definitions.my_project/componentsis where you will define custom component types, and optionally other code you wish to share across Dagster definitions.my_project/definitions.pyis the entry point that Dagster will load when deploying your code location. It is configured to load all definitions frommy_project/defs. You should not need to modify this file.testsis a separate Python package defined at the top level (outsidesrc). It should contain tests for themy_projectpackage.pyproject.tomlis a standard Python package configuration file. In addition to the regular Python package metadata, it contains atool.dgsection fordg-specific settings.