Skip to content

initialize_project

Module: flowerpower.flowerpower

The initialize_project function initializes a new FlowerPower project. It is a convenient top-level function that wraps FlowerPowerProject.new().

initialize_project(name: str | None = None, base_dir: str | None = None, storage_options: dict | BaseStorageOptions | None = {}, fs: AbstractFileSystem | None = None, hooks_dir: str = settings.HOOKS_DIR, log_level: str | None = None) -> FlowerPowerProject

Initializes a new FlowerPower project.

Parameter Type Description
name str | None The name of the project. Defaults to the current directory name.
base_dir str | None The base directory where the project will be created. Defaults to the current working directory.
storage_options dict | BaseStorageOptions | None Storage options for the filesystem.
fs AbstractFileSystem | None An instance of AbstractFileSystem to use for file operations.
hooks_dir str The directory where the project hooks will be stored.
log_level str | None The logging level to set for the project. If None, it uses the default log level.

Returns: A FlowerPowerProject instance initialized with the new project.

Raises: FileExistsError if the project already exists at the specified base directory.

Example

```python from flowerpower import initialize_project

Initialize a new project

project = initialize_project(name="my-new-project")

To overwrite an existing project, use FlowerPowerProject.new(..., overwrite=True)