Set up a project
Create the directory that Bauplan runs as a unit, with your models, their expectations and a project file. Use this page when you start a new pipeline, or when you add one to an existing repository. Where projects sit in a repository is covered in how to structure a Bauplan repository, and what a project is in pipelines and expectations.
Create the project file
Run bauplan init in the directory, or pass the directory and a name:
bauplan init <project_dir> --name <project_name>
It writes a bauplan_project.yaml with a new project ID, a starter models.py and a pyproject.toml. It fails if the directory already has a project file. To write bauplan_project.yaml by hand, include only a project block with an id and a name:
project:
id: <a new UUID>
name: <project_name>
Generate the ID once and never change it. Secrets are bound to the project ID. A new ID makes every secret of the project unreadable, and you have to set them again; see store secrets.
Run parameters go in a separate parameters block of the same file; see declare the parameters. Don't write secret values by hand; see store secrets.
A key Bauplan doesn't know is reported as a warning, not an error. Check the warnings of the first run for typos.
Put the model files at the top of the directory
Put every .py and .sql file the run needs at the top level of the project directory, next to the project file. A run sends only those files, the project file, and any SQL files listed in include_paths inside bauplan_project.yaml. Other code in subfolders, and anything outside the directory, isn't available to the models.
- If you want SQL files in subfolders, list them in
include_paths; see how to organize SQL files. - If several projects share Python code, see how to share code across projects.
- Keep client-side scripts out of the project directory; see how to structure a Bauplan repository.
Keep each pipeline in its own project directory. A project is run as a unit. A self-contained directory can be developed, tested, and run on its own. For how to split models across projects, see how to structure a Bauplan project.
Keep the models of one pipeline in one file, and their logic in plain functions in a separate top-level module that the models call. The models and their environments then stay in one place, and the business logic can be refactored apart from them. To share those modules between projects, see how to share code across projects.
Run the project
Run it on your branch from its directory, or point at it:
bauplan run --project-dir <project_dir>
Writing the models is covered in how to write a pipeline.