MCPcopy
hub / github.com/microsoft/markitdown / main

Function main

packages/markitdown/src/markitdown/__main__.py:14–258  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13
14def main():
15 parser = argparse.ArgumentParser(
16 description="Convert various file formats to markdown.",
17 prog="markitdown",
18 formatter_class=argparse.RawDescriptionHelpFormatter,
19 usage=dedent(
20 """
21 SYNTAX:
22
23 markitdown <OPTIONAL: FILENAME>
24 If FILENAME is empty, markitdown reads from stdin.
25
26 EXAMPLE:
27
28 markitdown example.pdf
29
30 OR
31
32 cat example.pdf | markitdown
33
34 OR
35
36 markitdown < example.pdf
37
38 OR to save to a file use
39
40 markitdown example.pdf -o example.md
41
42 OR
43
44 markitdown example.pdf > example.md
45 """
46 ).strip(),
47 )
48
49 parser.add_argument(
50 "-v",
51 "--version",
52 action="version",
53 version=f"%(prog)s {__version__}",
54 help="show the version number and exit",
55 )
56
57 parser.add_argument(
58 "-o",
59 "--output",
60 help="Output file name. If not provided, output is written to stdout.",
61 )
62
63 parser.add_argument(
64 "-x",
65 "--extension",
66 help="Provide a hint about the file extension (e.g., when reading from stdin).",
67 )
68
69 parser.add_argument(
70 "-m",
71 "--mime-type",

Callers 1

__main__.pyFile · 0.70

Calls 7

convert_streamMethod · 0.95
convertMethod · 0.95
_exit_with_errorFunction · 0.85
StreamInfoClass · 0.85
MarkItDownClass · 0.85
_handle_outputFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…