Skip to main content

prefect.settings.profiles

Functions

load_profiles

Load profiles from the current profile path. Optionally include profiles from the default profile path.

load_current_profile

Load the current profile from the default and current profile paths. This will not include settings from the current settings context. Only settings that have been persisted to the profiles file will be saved.

save_profiles

Writes all non-default profiles to the current profiles path.

load_profile

Load a single profile by name.

update_current_profile

Update the persisted data for the profile currently in-use. If the profile does not exist in the profiles file, it will be created. Given settings will be merged with the existing settings as described in ProfilesCollection.update_profile. Returns:
  • The new profile.

Classes

Profile

A user profile containing settings. Methods:

to_environment_variables

Convert the profile settings to a dictionary of environment variables.

validate_settings

Validate all settings in this profile by creating a partial Settings object with the nested structure properly constructed using accessor paths.

ProfilesCollection

” A utility class for working with a collection of profiles. Profiles in the collection must have unique names. The collection may store the name of the active profile. Methods:

active_profile

Retrieve the active profile in this collection.

add_profile

Add a profile to the collection. If the profile name already exists, an exception will be raised.

items

names

Return a set of profile names in this collection.

remove_profile

Remove a profile from the collection.

set_active

Set the active profile name in the collection. A null value may be passed to indicate that this collection does not determine the active profile.

to_dict

Convert to a dictionary suitable for writing to disk.

update_profile

Add a profile to the collection or update the existing on if the name is already present in this collection. If updating an existing profile, the settings will be merged. Settings can be dropped from the existing profile by setting them to None in the new profile. Returns the new profile object.

without_profile_source

Remove profiles that were loaded from a given path. Returns a new collection.