Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
vs4vijay committed Dec 22, 2024
1 parent 206b4a5 commit 0508471
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/markitdown/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from textwrap import dedent
from .__about__ import __version__
from ._markitdown import MarkItDown, DocumentConverterResult
import uvicorn


def main():
Expand Down Expand Up @@ -57,9 +58,16 @@ def main():
"--output",
help="Output file name. If not provided, output is written to stdout.",
)
parser.add_argument(
"--api",
action="store_true",
help="Start the FastAPI server",
)
args = parser.parse_args()

if args.filename is None:
if args.api:
uvicorn.run("src.markitdown.api:app", host="0.0.0.0", port=8000)
elif args.filename is None:
markitdown = MarkItDown()
result = markitdown.convert_stream(sys.stdin.buffer)
_handle_output(args, result)
Expand Down

0 comments on commit 0508471

Please sign in to comment.