shell_tools
_touch_clean(path: str | Path, mode: int = 436) -> None
Creates a file with the specified mode, overwriting the file if it exists.
This function is a helper function for the touch
function. It is not
meant to be used outside of this module.
Parameters
path The path of the file to create. mode The permission mode to use in file creation.
Source code in src/rra_tools/shell_tools.py
mkdir(path: str | Path, mode: int = 509, *, exist_ok: bool = False, parents: bool = False) -> None
Creates a directory and its parents with the specified mode.
This method is meant to combat permissions errors generated by the default umask behavior when creating parent directories (i.e. ignore the mode argument and use the default permissions).
Parameters
path The path of the directory to create. mode The permission mode to use in directory creation. exist_ok If False, raises FileExistsError if the directory already exists. parents If False, raises FileNotFoundError if the directory's parent doesn't exist.
Source code in src/rra_tools/shell_tools.py
touch(path: str | Path, mode: int = 436, *, exist_ok: bool = False, clobber: bool = False) -> None
Creates a file with the specified mode.
Parameters
path The path of the file to create. mode The permission mode to use in file creation. exist_ok If False, raises FileExistsError if the file already exists. If True, raises FileExistsError if path is a directory or permissions do not match the mode argument. clobber If True, overwrites the file if it already exists.
Source code in src/rra_tools/shell_tools.py
unzip_and_delete_archive(archive_path: str | Path, output_path: str | Path) -> None
Unzips an archive file to a directory and then deletes the archive.
Parameters
archive_path The path to the archive we want to unzip. output_path The place to store the unzipped contents.
Source code in src/rra_tools/shell_tools.py
wget(url: str, output_path: str | Path) -> None
Retrieves content at the url and stores it at an output path.
Parameters
url The url to retrieve the content from. output_path Where we'll save the output to.