CLI
download
Download file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
direct_link |
str
|
Sharing link to the file on GutHub. |
required |
filepath |
Path
|
Path to the downloaded file. |
required |
Source code in src/trecover/utils/cli.py
get_real_direct_link
Get a direct download link.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sharing_link |
str
|
Sharing link to the file on Yandex disk. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Direct link if it converts, otherwise None. |
Source code in src/trecover/utils/cli.py
extract_filename
Get filename of downloaded data
download_from_disk
Download file from Yandex disk.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sharing_link |
str
|
Sharing link to the file on Yandex disk. |
required |
save_dir |
Path
|
Path where to store downloaded file. |
required |
Returns:
Name | Type | Description |
---|---|---|
filepath |
Optional[Path]
|
Path to the file if download was successful, otherwise None. |
Source code in src/trecover/utils/cli.py
download_from_github
Download file from GutHub assets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
direct_link |
str
|
Sharing link to the file on GutHub. |
required |
save_dir |
Path
|
Path where to store downloaded file. |
required |
Returns:
Name | Type | Description |
---|---|---|
filepath |
Path
|
Path to the downloaded file. |
Source code in src/trecover/utils/cli.py
download_archive
Download archive file and extract it to save_dir.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link |
str
|
Sharing link to the archive file on Yandex disk or GitHub assets. |
required |
save_dir |
Path
|
Path where to store extracted data |
required |
yandex_disk |
bool, default
|
If the link is to Yandex disk. |
False
|
Source code in src/trecover/utils/cli.py
get_files_columns
Get columns for keyless reading from plain data contained in the files with defined noise range.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inference_path |
Path
|
Paths to folder with files that contain data to read or create noised columns for keyless reading. |
required |
separator |
str
|
Separator to split the data into columns. |
required |
noisy |
bool
|
Indicates that the data in the files is already noisy and contains columns for keyless reading. |
required |
min_noise |
int
|
Minimum noise range value. |
required |
max_noise |
int
|
Maximum noise range value. |
required |
n_to_show |
int
|
Maximum number of columns. Zero means no restrictions. |
required |
Returns:
Type | Description |
---|---|
files, files_columns
|
List of paths and batch of columns for keyless reading. |
Source code in src/trecover/utils/cli.py
parse_config
Parse configuration file for 'trecover up' command.
Source code in src/trecover/utils/cli.py
start_service
Start service as a new process with given pid and log files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
argv |
List[str]
|
New process command. |
required |
name |
str
|
Service name. |
required |
logfile |
Path
|
Service logfile path. |
required |
pidfile |
Path
|
Service pidfile path. |
required |
Source code in src/trecover/utils/cli.py
stop_service
Send an interrupt signal to the process with given pid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Service name. |
required |
pidfile |
Path
|
Service pidfile path. |
required |
logfile |
Path
|
Service logfile path. |
required |
Source code in src/trecover/utils/cli.py
check_service
Display status of the process with given pid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Service name. |
required |
pidfile |
Path
|
Service pidfile path. |
required |
Source code in src/trecover/utils/cli.py
stream
Get a generator that yields the services' stdout streams.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*services |
Union[Tuple[str, Path], Tuple[Tuple[str, Path]]]
|
Sequence of services' names and logfile's paths. |
()
|
live |
bool, default
|
Yield only new services' logs. |
False
|
period |
float, default
|
Generator's delay. |
0.1
|
Returns:
Type | Description |
---|---|
Optional[Generator[str, None, None]]
|
Generator that yields the services' stdout streams or None if services are stopped. |