From a1766c59814fe67bc1a2878e663e29f8607f13a6 Mon Sep 17 00:00:00 2001 From: tungsten106 Date: Tue, 7 Jan 2025 15:05:30 +0800 Subject: [PATCH] update: cli options added for engine selection --- src/markitdown/__main__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/markitdown/__main__.py b/src/markitdown/__main__.py index b6cf963..8952fd4 100644 --- a/src/markitdown/__main__.py +++ b/src/markitdown/__main__.py @@ -57,7 +57,18 @@ def main(): "--output", help="Output file name. If not provided, output is written to stdout.", ) + # adding CLI option for extra parameters for PdfConverter + parser.add_argument( + "-e", + "--engine", + help="Engine name for converters. If not provided will use default.", + ) + args = parser.parse_args() + + kwargs = {} + if args.engine: + kwargs.update({"engine": args.engine}) if args.filename is None: markitdown = MarkItDown() @@ -65,7 +76,7 @@ def main(): _handle_output(args, result) else: markitdown = MarkItDown() - result = markitdown.convert(args.filename) + result = markitdown.convert(args.filename, **kwargs) _handle_output(args, result)