gnomad_toolbox.scripts

Script to copy Jupyter notebooks and configurations to a user-specified directory.

Module Functions

gnomad_toolbox.scripts.load_config([config_file])

Load configuration from a JSON file.

gnomad_toolbox.scripts.save_config(config[, ...])

Save configuration to a JSON file.

gnomad_toolbox.scripts.set_config(key, value)

Add a key-value pair to the configuration file, supporting nested keys.

gnomad_toolbox.scripts.get_config(key[, ...])

Retrieve a value from the configuration file by key, supporting nested keys.

gnomad_toolbox.scripts.copy_directory(src, dest)

Copy a directory to a destination.

gnomad_toolbox.scripts.copy_notebooks(...[, ...])

Copy Jupyter notebooks and configurations to a user-specified directory.

gnomad_toolbox.scripts.run_jupyter_cli()

Launch Jupyter Lab or Notebook using the configured directory.

Script to copy Jupyter notebooks and configurations to a user-specified directory.

gnomad_toolbox.scripts.load_config(config_file='/home/runner/.gnomad_toolbox_config.json')[source]

Load configuration from a JSON file.

Parameters:

config_file (str) – Path to the configuration file.

Return type:

dict

Returns:

The configuration dictionary.

gnomad_toolbox.scripts.save_config(config, config_file='/home/runner/.gnomad_toolbox_config.json')[source]

Save configuration to a JSON file.

Parameters:
  • config (dict) – The configuration dictionary.

  • config_file (str) – Path to the configuration file.

Return type:

None

Returns:

None.

gnomad_toolbox.scripts.set_config(key, value, config_file='/home/runner/.gnomad_toolbox_config.json')[source]

Add a key-value pair to the configuration file, supporting nested keys.

Parameters:
  • key (str) – The key to save, with nesting indicated by periods.

  • value (Union[str, dict]) – The value to save.

  • config_file (str) – Path to the configuration file.

Return type:

None

Returns:

None.

gnomad_toolbox.scripts.get_config(key, config_file='/home/runner/.gnomad_toolbox_config.json')[source]

Retrieve a value from the configuration file by key, supporting nested keys.

Parameters:
  • key (str) – The key to retrieve, with nesting indicated by periods.

  • config_file (str) – Path to the configuration file.

Return type:

Optional[str]

Returns:

The value associated with the key, or None if the key doesn’t exist.

gnomad_toolbox.scripts.copy_directory(src, dest, overwrite=False)[source]

Copy a directory to a destination.

Parameters:
  • src (str) – Source directory.

  • dest (str) – Destination directory.

  • overwrite (bool) – Whether to overwrite if the destination exists.

Return type:

None

Returns:

None.

gnomad_toolbox.scripts.copy_notebooks(destination, overwrite=False)[source]

Copy Jupyter notebooks and configurations to a user-specified directory.

Parameters:
  • destination (str) – The target directory.

  • overwrite (bool) – Whether to overwrite existing files/directories.

Return type:

None

Returns:

None.

gnomad_toolbox.scripts.run_jupyter_cli()[source]

Launch Jupyter Lab or Notebook using the configured directory.

Return type:

None

Returns:

None.