Add a `serve` command to start a CORS-enabled Flask server for file conversion. * **New Flask Server**: Add `src/markitdown/server.py` to define a Flask server with CORS enabled and a route to convert files to markdown. * **Dependencies**: Update `pyproject.toml` to include `flask` and `flask-cors` as dependencies and add the `serve` command to the `[project.scripts]` section. * **Documentation**: Update `README.md` with instructions on how to use the `serve` command. * **Tests**: Add tests in `tests/test_markitdown.py` to verify the functionality of the `serve` command, including handling both URL and file POST data. In case we decide not to have `serve` command we have [markdown-converter](https://pypi.org/project/markdown-converter/).
86 lines
2 KiB
TOML
86 lines
2 KiB
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "markitdown"
|
|
dynamic = ["version"]
|
|
description = 'Utility tool for converting various files to Markdown'
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
license = "MIT"
|
|
keywords = []
|
|
authors = [
|
|
{ name = "Adam Fourney", email = "adamfo@microsoft.com" },
|
|
]
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"Programming Language :: Python",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
]
|
|
dependencies = [
|
|
"beautifulsoup4",
|
|
"requests",
|
|
"mammoth",
|
|
"markdownify",
|
|
"numpy",
|
|
"python-pptx",
|
|
"pandas",
|
|
"openpyxl",
|
|
"pdfminer.six",
|
|
"puremagic",
|
|
"pydub",
|
|
"youtube-transcript-api",
|
|
"SpeechRecognition",
|
|
"pathvalidate",
|
|
"charset-normalizer",
|
|
"openai",
|
|
"flask",
|
|
"flask-cors",
|
|
]
|
|
|
|
[project.urls]
|
|
Documentation = "https://github.com/microsoft/markitdown#readme"
|
|
Issues = "https://github.com/microsoft/markitdown/issues"
|
|
Source = "https://github.com/microsoft/markitdown"
|
|
|
|
[tool.hatch.version]
|
|
path = "src/markitdown/__about__.py"
|
|
|
|
[project.scripts]
|
|
markitdown = "markitdown.__main__:main"
|
|
serve = "markitdown.server:app.run"
|
|
|
|
[tool.hatch.envs.types]
|
|
extra-dependencies = [
|
|
"mypy>=1.0.0",
|
|
]
|
|
[tool.hatch.envs.types.scripts]
|
|
check = "mypy --install-types --non-interactive {args:src/markitdown tests}"
|
|
|
|
[tool.coverage.run]
|
|
source_pkgs = ["markitdown", "tests"]
|
|
branch = true
|
|
parallel = true
|
|
omit = [
|
|
"src/markitdown/__about__.py",
|
|
]
|
|
|
|
[tool.coverage.paths]
|
|
markitdown = ["src/markitdown", "*/markitdown/src/markitdown"]
|
|
tests = ["tests", "*/markitdown/tests"]
|
|
|
|
[tool.coverage.report]
|
|
exclude_lines = [
|
|
"no cov",
|
|
"if __name__ == .__main__.:",
|
|
"if TYPE_CHECKING:",
|
|
]
|
|
|
|
[tool.hatch.build.targets.sdist]
|
|
only-include = ["src/markitdown"]
|