Skip to main content

atmos.profile

The atmos.profile function runs atmos profile through the current Atmos executable. Use it to discover the configuration profiles available to a project and to read the details of one profile.

Usage​

atmos.profile(
*positionals,
flags = {},
args = [],
working_directory = ...,
env = ...,
output = "stream",
check = True,
)

Subcommands​

Pass the subcommand and its positional arguments as strings before the keyword arguments. The call atmos.profile("show", "developer") runs atmos profile show developer.

SubcommandPurpose
listList available configuration profiles.
showShow detailed information about a profile.

See the atmos profile command reference for the complete list of subcommands and flags.

Arguments​

*positionals

(Optional) Strings placed on the command line right after profile, in order: the subcommand and its positional arguments, such as the profile name for show. Every value must be a string.

flags

(Optional) A dictionary of command-line options; see flag translation. The key "format" becomes --format , and the registered shorthand "f" resolves to the same flag. The list subcommand accepts table, json, or yaml, and show accepts text, json, or yaml.

args
(Optional) A list or tuple of strings appended after the flags.
working_directory, env, output, check

(Optional) See atmos.run for process options and defaults.

Options other than the positionals are keyword-only.

Returns​

A result with stdout, stderr, and exit_code. See atmos.run for output and error behavior.

Examples​

List the profiles as data​

profiles = json.decode(atmos.profile("list", flags = {"format": "json"}, output = "capture").stdout)
for profile in profiles:
print(profile["Name"], profile["Files"])

The JSON output is a list of objects with keys such as Name, Path, and Files.

Show one profile​

details = atmos.profile("show", "developer", flags = {"format": "yaml"}, output = "capture")
print(details.stdout)

Check that a profile exists​

probe = atmos.profile("show", "ci", output = "capture", check = False)
if probe.exit_code != 0:
fail("The ci profile is not available:\n" + probe.stderr)