import argparse
import sys
from pathlib import Path


ROOT = Path(__file__).resolve().parent.parent
if str(ROOT) not in sys.path:
    sys.path.insert(0, str(ROOT))

from src.quant_engine.convert_xlsx_to_json import convert_xlsx_to_json, DEFAULT_XLSX, DEFAULT_JSON


def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("--xlsx", default=str(DEFAULT_XLSX))
    parser.add_argument("--out", default=str(DEFAULT_JSON))
    args = parser.parse_args()

    convert_xlsx_to_json(Path(args.xlsx), Path(args.out))
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
