nvflare.utils.cli_utils module

append_if_not_in_list(arr: List, item) List[source]
backup_hidden_config_file(hidden_nvflare_config_file: str) str | None[source]
check_dir(dir_path: str)[source]
create_job_template_config(nvflare_config: ConfigTree, job_templates_dir: str | None = None) ConfigTree[source]
Parameters:
  • job_templates_dir – specified job template directory

  • nvflare_config (ConfigTree) – The existing nvflare configuration.

Returns:

The merged configuration tree.

Return type:

ConfigTree

create_poc_workspace_config(nvflare_config: ConfigTree, poc_workspace_dir: str | None = None) ConfigTree[source]
Parameters:
  • poc_workspace_dir – specified poc_workspace_dir

  • nvflare_config (ConfigTree) – The existing nvflare configuration.

Returns:

The merged configuration tree.

Return type:

ConfigTree

find_in_list(arr: List, item) bool[source]
find_job_templates_location(job_templates_dir: str | None = None)[source]
find_startup_kit_config_keys(nvflare_config: ConfigTree) List[str][source]

Return old startup-kit config keys that should no longer be persisted.

get_curr_dir()[source]
get_hidden_config() -> (<class 'str'>, <class 'pyhocon.config_tree.ConfigTree'>)[source]
get_hidden_nvflare_config_path(hidden_nvflare_dir: str) str[source]

Get the path for the hidden nvflare configuration file. :param hidden_nvflare_dir: ~/.nvflare directory

Returns:

The path to the hidden nvflare configuration file.

Return type:

str

get_hidden_nvflare_dir() Path[source]
get_home_dir() Path[source]
get_or_create_hidden_nvflare_dir()[source]
get_package_root() Path[source]
Get the nvflare package root folder, e.g.

/usr/local/python/3.10/lib/python3.10/site-packages/nvflare

hocon_to_string(target_fmt: ConfigFormat, dst_config: ConfigTree)[source]
is_dir_empty(path: str)[source]
load_config(config_file_path) ConfigTree | None[source]
load_hidden_config() ConfigTree[source]
load_hidden_config_state() Tuple[str, ConfigTree | None, bool][source]
print_hidden_config(dst_path: str, dst_config: ConfigTree)[source]
remove_startup_kit_config_keys(nvflare_config: ConfigTree) ConfigTree[source]

Remove obsolete startup kit config keys without touching the startup_kits registry.

save_config(dst_config: ConfigTree, dst_path, keep_origin_format: bool = True)[source]
save_configs(app_configs: Dict[str, Tuple], keep_origin_format: bool = True)[source]