INNER CODE UNIT · Python
main
linnabrown/run_dbcan · dbcan/cli/cgc_process_json.py:224
def main():
"""
Main function to compile JSON from a 'cgc_standard.out' file.
This function parses command-line arguments to get input and output file paths, reads the input file, processes and renames columns, and writes the processed data to a JSON file using a custom JSON encoder.
Side Effects:
- Reads a specified input file.
- Writes processed data to a JSON output file.
- Can terminate the script if the input file does not have the correct extension.
"""
parser = argparse.ArgumentParser(description="Compiling Json from cgc_standard.out")
parser.add_argument(
"-i",
required=True,
help="path to output file (cgc_standard.out) file",
type=lambda s: file_ext(("out", "csv"), s, parser),
)