-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from KristinaGomoryova/cli
Implementation of CLI for the processing metadata or alkane files
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import click | ||
|
||
from rcx_tk.process_metadata_file import process_alkane_ri_file, process_metadata_file | ||
|
||
|
||
@click.command() | ||
@click.option('--method', type=click.Choice(['metadata', 'alkanes']), required = True, help = 'A file type to be processed, either metadata or alkanes file.') | ||
@click.argument('file_path') | ||
@click.argument('out_path') | ||
def main(method, file_path, out_path): | ||
"""Process metadata or alkane file. | ||
Args: | ||
file_path (path): A path to the input data. | ||
out_path (path): A path where the processed data will be exported to. | ||
""" | ||
if method == "metadata": | ||
process_metadata_file(file_path, out_path) | ||
click.echo("Metadata done!") | ||
elif method == "alkanes": | ||
process_alkane_ri_file(file_path, out_path) | ||
click.echo("Alkanes done!") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |