diff --git a/pyproject.toml b/pyproject.toml index a43df0c..8236d9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -128,4 +129,7 @@ filename = "pyproject.toml" filename = "CITATION.cff" [[tool.bumpversion.files]] -filename = "docs/conf.py" \ No newline at end of file +filename = "docs/conf.py" + +[tool.poetry.scripts] +rcx_tk = "rcx_tk.__main__:main" \ No newline at end of file diff --git a/src/rcx_tk/__main__.py b/src/rcx_tk/__main__.py new file mode 100644 index 0000000..dfbcc3f --- /dev/null +++ b/src/rcx_tk/__main__.py @@ -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() \ No newline at end of file