ladybug.commandutil module

Utility functions for running the functions of CLI commands outside of the CLI.

ladybug.commandutil.process_content_to_output(content_str, output_file=None)[source]

Process output strings from commands for various formats of output_files.

Parameters:
  • content_str – A text string for file contents that are being output from a command.

  • output_file – Any of the typically supported –output-file types of the CLI. This can be a string for a file path, a file object, or the stdout file object used by click. If None, the string is simply returned from this method. (Default: None).

ladybug.commandutil.run_command_function(command_function, arguments=None, options=None)[source]

Run a function used within the Ladybug Tools CLI.

Parameters:
  • command_function – The CLI function to be executed.

  • arguments – A list of required arguments for the command_function. None can be used if the command function has no required arguments. (Default: None).

  • options – A dictionary of options to be passed to the function. The keys of this dictionary should be the full names of the options or flags in the CLI and formatted with dashes (eg. –output-file). The values of the dictionary should be the values to be passed for each of the options. For the case of flag arguments, the value should simply be an empty string. None can be used here to indicate that all default values for options should be used. (Default: None).