arrakis.utils.io
I/O utilities
Attributes
Functions
|
|
|
Copy data from src to dst. |
|
|
|
Get a table from a directory given a keyword to glob. |
|
Parse an environment path. |
|
|
|
|
|
Create directory if it doesn't exist |
|
Create symlink if it doesn't exist |
|
Module Contents
- arrakis.utils.io.copyfile(src, dst, *, follow_symlinks=True, verbose=True)[source]
Copy data from src to dst.
If follow_symlinks is not set and src is a symbolic link, a new symlink will be created instead of copying the file it points to.
- arrakis.utils.io.gettable(tabledir: str, keyword: str, verbose=True) Tuple[astropy.table.Table, str] [source]
Get a table from a directory given a keyword to glob.
- Parameters:
tabledir (str) – Directory.
keyword (str) – Keyword to glob for.
verbose (bool, optional) – Verbose output. Defaults to True.
- Returns:
Table and it’s file location.
- Return type:
Tuple[Table, str]
- arrakis.utils.io.parse_env_path(env_path: arrakis.utils.typing.PathLike) pathlib.Path [source]
Parse an environment path.
- Parameters:
env_path (str) – Environment path.
- Returns:
Parsed path.
- Return type:
Path
- arrakis.utils.io.try_mkdir(dir_path: str, verbose=True)[source]
Create directory if it doesn’t exist
- Parameters:
dir_path (str) – Path to directory
verbose (bool, optional) – Verbose output. Defaults to True.