gnomad_toolbox.scripts
Script to copy Jupyter notebooks and configurations to a user-specified directory.
Module Functions
|
Load configuration from a JSON file. |
|
Save configuration to a JSON file. |
|
Add a key-value pair to the configuration file, supporting nested keys. |
|
Retrieve a value from the configuration file by key, supporting nested keys. |
|
Copy a directory to a destination. |
|
Copy Jupyter notebooks and configurations to a user-specified directory. |
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.