Skip to content

Commit

Permalink
Merge pull request #19 from KristinaGomoryova/cli
Browse files Browse the repository at this point in the history
Implementation of CLI for the processing metadata or alkane files
  • Loading branch information
hechth authored Jul 8, 2024
2 parents 50edef2 + 1863439 commit f536b27
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ keywords = ["metadata", "alkanes", "metabolomics"]
python = "^3.11"
pandas = "^2.2.2"
pyxlsx = "^1.1.3"
click = "^8.1.7"

[tool.poetry.group.dev.dependencies]
build = "^1.2.1"
Expand Down Expand Up @@ -128,4 +129,7 @@ filename = "pyproject.toml"
filename = "CITATION.cff"

[[tool.bumpversion.files]]
filename = "docs/conf.py"
filename = "docs/conf.py"

[tool.poetry.scripts]
rcx_tk = "rcx_tk.__main__:main"
26 changes: 26 additions & 0 deletions src/rcx_tk/__main__.py
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()

0 comments on commit f536b27

Please sign in to comment.