pcf.cli package

Submodules

pcf.cli.cli module

Top-level CLI module for interacting with PCF Particles and Quasiparticles

class pcf.cli.cli.PCFCLI(name=None, invoke_without_command=False, no_args_is_help=None, subcommand_metavar=None, chain=False, result_callback=None, **attrs)

Bases: click.core.MultiCommand

command_dir = '/Users/zal639/repos/Particle-Cloud-Framework/pcf/cli/commands'
get_command(ctx, cmd_name)

Attempt to load and return the command provided by the user

list_commands(ctx=None)

List command names and their descriptions

static print_version(ctx)

Print the pcf version

pcf.cli.utils module

Utility functions for the PCF CLI

pcf.cli.utils.click_options(options)

Decorator used to add a list of click.options to click command functions

pcf.cli.utils.color(color)

Return the desired color name or None if the NO_COLOR env var is set https://no-color.org

pcf.cli.utils.did_you_mean(suggestions=[], fg=None, exit_after=True, exit_code=1)

Print the ‘Did you mean’ message for the given suggestion string(s) in the optional color.

pcf.cli.utils.execute_applying_command(pcf_name, config_file, desired_state, cascade=False, quiet=False, timeout=None)

Executes the apply command for the desired particle(s) and state as specified in the config_file. Used for apply, run, stop, and terminate commands. Contains CLI output for info.

pcf.cli.utils.fail(error_msg, fg='red')

Display the error message and fail the CLI

pcf.cli.utils.load_pcf_config_from_file(filename)

Attempts to load and return the config dict as specified in the given file with the following default config file precedence: 1. pcf.json 2. pcf.yml 3. pcf.yaml

pcf.cli.utils.particle_class_instance(flavor, particle_config)

Return a particle class from a flavor or handle CLI error message

pcf.cli.utils.particles_from_file(pcf_name, filename, quiet=False)

Return a list of Particles from a PCF config file, returning only one Particle if pcf_name is not None

pcf.cli.utils.read_config_file(filename)

Loads the JSON/YAML filename and returns it as a dict.

pcf.cli.utils.similar_strings(given_str, search_list=[])

Returns a list of similar strings to given_str from an iterable of potentially similar strings, search_list.

Module contents