23 lines
555 B
Python
23 lines
555 B
Python
from __future__ import annotations
|
|
|
|
import argparse
|
|
from pathlib import Path
|
|
|
|
from docx_ops_lib import render_docx, write_json
|
|
|
|
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--docx", required=True)
|
|
parser.add_argument("--out-dir", required=True)
|
|
parser.add_argument("--report")
|
|
args = parser.parse_args()
|
|
|
|
report = render_docx(Path(args.docx).resolve(), Path(args.out_dir).resolve())
|
|
if args.report:
|
|
write_json(Path(args.report).resolve(), report)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|