User Config

User-level configuration for pypreset defaults.

Reads from ~/.config/pypreset/config.yaml and provides defaults that are applied during project creation and augmentation.

pypreset.user_config.get_config_path()[source]

Return the path to the user config file.

Return type:

Path

pypreset.user_config.load_user_config()[source]

Load user configuration from disk.

Returns an empty dict if the file doesn’t exist or is invalid.

Return type:

dict[str, Any]

pypreset.user_config.apply_user_defaults(config)[source]

Apply user defaults to a project config dict.

User defaults are applied as a base layer — preset values and CLI overrides take precedence (they are applied after this).

Parameters:

config (dict[str, Any])

Return type:

dict[str, Any]

pypreset.user_config.save_user_config(config)[source]

Save configuration to the user config file.

Returns the path written to.

Parameters:

config (dict[str, Any])

Return type:

Path

pypreset.user_config.get_default_config_template()[source]

Return a commented example config for scaffolding.

Return type:

dict[str, Any]