markitdown AI技能包 是 AI Skill Hub 本期精选AI工具之一。在 GitHub 上收获超过 123.1k 颗 Star,综合评分 8.8 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
微软开源的Python工具,将各类文件和Office文档智能转换为Markdown格式。支持PDF、Word、Excel、PowerPoint等多种格式,适合开发者、内容编辑和AI工程师快速处理文档数据。
markitdown AI技能包 是一款基于 Python 开发的开源工具,专注于 文档转换、Markdown、Office处理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
微软开源的Python工具,将各类文件和Office文档智能转换为Markdown格式。支持PDF、Word、Excel、PowerPoint等多种格式,适合开发者、内容编辑和AI工程师快速处理文档数据。
markitdown AI技能包 是一款基于 Python 开发的开源工具,专注于 文档转换、Markdown、Office处理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install markitdown
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install markitdown
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/microsoft/markitdown
cd markitdown
pip install -e .
# 验证安装
python -c "import markitdown; print('安装成功')"
# 命令行使用
markitdown --help
# 基本用法
markitdown input_file -o output_file
# Python 代码中调用
import markitdown
# 示例
result = markitdown.process("input")
print(result)
# markitdown 配置文件示例(config.yml) app: name: "markitdown" debug: false log_level: "INFO" # 运行时指定配置文件 markitdown --config config.yml # 或通过环境变量配置 export MARKITDOWN_API_KEY="your-key" export MARKITDOWN_OUTPUT_DIR="./output"
[!IMPORTANT] MarkItDown performs I/O with the privileges of the current process. Like open() or requests.get(), it will access resources that the process itself can access. Sanitize your inputs in untrusted environments, and call the narrowestconvert_*function needed for your use case (e.g.,convert_stream(), orconvert_local()). See the Security Considerations section of the documentation for more information.
MarkItDown is a lightweight Python utility for converting various files to Markdown for use with LLMs and related text analysis pipelines. To this end, it is most comparable to textract, but with a focus on preserving important document structure and content as Markdown (including: headings, lists, tables, links, etc.) While the output is often reasonably presentable and human-friendly, it is meant to be consumed by text analysis tools -- and may not be the best option for high-fidelity document conversions for human consumption.
MarkItDown currently supports the conversion from:
MarkItDown requires Python 3.10 or higher. It is recommended to use a virtual environment to avoid dependency conflicts.
With the standard Python installation, you can create and activate a virtual environment using the following commands:
python -m venv .venv
source .venv/bin/activate
If using uv, you can create a virtual environment with:
```bash uv venv --python=3.12 .venv source .venv/bin/activate
MarkItDown has optional dependencies for activating various file formats. Earlier in this document, we installed all optional dependencies with the [all] option. However, you can also install them individually for more control. For example:
pip install 'markitdown[pdf, docx, pptx]'
will install only the dependencies for PDF, DOCX, and PPTX files.
At the moment, the following optional dependencies are available:
[all] Installs all optional dependencies[pptx] Installs dependencies for PowerPoint files[docx] Installs dependencies for Word files[xlsx] Installs dependencies for Excel files[xls] Installs dependencies for older Excel files[pdf] Installs dependencies for PDF files[outlook] Installs dependencies for Outlook messages[az-doc-intel] Installs dependencies for Azure Document Intelligence[az-content-understanding] Installs dependencies for Azure Content Understanding[audio-transcription] Installs dependencies for audio transcription of wav and mp3 files[youtube-transcription] Installs dependencies for fetching YouTube video transcription
If you are using Anaconda, you can create a virtual environment with:
bash conda create -n markitdown python=3.12 conda activate markitdown ```
To install MarkItDown, use pip: pip install 'markitdown[all]'. Alternatively, you can install it from the source:
git clone git@github.com:microsoft/markitdown.git
cd markitdown
pip install -e 'packages/markitdown[all]'
docker build -t markitdown:latest .
docker run --rm -i markitdown:latest < ~/your-file.pdf > output.md
md = MarkItDown(cu_endpoint="<content_understanding_endpoint>") result = md.convert("report.pdf") # documents → prebuilt-documentSearch result = md.convert("meeting.mp4") # video → prebuilt-videoSearch result = md.convert("call.wav") # audio → prebuilt-audioSearch print(result.markdown)
**With a custom analyzer** (for domain-specific field extraction):
python md = MarkItDown( cu_endpoint="<content_understanding_endpoint>", cu_analyzer_id="my-invoice-analyzer", ) result = md.convert("invoice.pdf") print(result.markdown)
Basic usage in Python:
from markitdown import MarkItDown
md = MarkItDown(enable_plugins=False) # Set to True to enable plugins
result = md.convert("test.xlsx")
print(result.text_content)
Document Intelligence conversion in Python:
from markitdown import MarkItDown
md = MarkItDown(docintel_endpoint="<document_intelligence_endpoint>")
result = md.convert("test.pdf")
print(result.text_content)
To use Large Language Models for image descriptions (currently only for pptx and image files), provide llm_client and llm_model:
from markitdown import MarkItDown
from openai import OpenAI
client = OpenAI()
md = MarkItDown(llm_client=client, llm_model="gpt-4o", llm_prompt="optional custom prompt")
result = md.convert("example.jpg")
print(result.text_content)
MarkItDown also supports 3rd-party plugins. Plugins are disabled by default. To list installed plugins:
markitdown --list-plugins
To enable plugins use:
markitdown --use-plugins path-to-file.pdf
To find available plugins, search GitHub for the hashtag #markitdown-plugin. To develop a plugin, see packages/markitdown-sample-plugin.
The markitdown-ocr plugin adds OCR support to PDF, DOCX, PPTX, and XLSX converters, extracting text from embedded images using LLM Vision — the same llm_client / llm_model pattern that MarkItDown already uses for image descriptions. No new ML libraries or binary dependencies required.
Installation:
pip install markitdown-ocr
pip install openai # or any OpenAI-compatible client
Usage:
Pass the same llm_client and llm_model you would use for image descriptions:
from markitdown import MarkItDown
from openai import OpenAI
md = MarkItDown(
enable_plugins=True,
llm_client=OpenAI(),
llm_model="gpt-4o",
)
result = md.convert("document_with_images.pdf")
print(result.text_content)
If no llm_client is provided the plugin still loads, but OCR is silently skipped and the standard built-in converter is used instead.
See packages/markitdown-ocr/README.md for detailed documentation.
You can also contribute by creating and sharing 3rd party plugins. See packages/markitdown-sample-plugin for more details.
MarkItDown 是由 Microsoft AutoGen 团队开发的一款高效转换工具,旨在将多种格式的文件转换为易于阅读和处理的 Markdown 格式。它能够处理包括文档、视频及音频在内的多种媒体类型,通过强大的内容理解能力,帮助开发者轻松实现非结构化数据的结构化提取。
使用 MarkItDown 需要 Python 3.10 或更高版本。为了避免依赖冲突,强烈建议开发者使用虚拟环境进行开发。你可以使用标准的 Python 命令创建并激活虚拟环境,或者使用 Anaconda 环境(如 `conda create -n markitdown python=3.12`)来确保运行环境的隔离与稳定。
你可以通过 `pip install 'markitdown[all]'` 一键安装所有功能。若需从源码安装,请先 `git clone` 项目仓库,并在对应目录下执行 `pip install -e 'packages/markitdown[all]'`。此外,本项目支持 Docker 部署,通过 `docker build` 构建镜像后,可利用 `docker run` 实现快速的文件转换任务。
MarkItDown 支持零配置(Zero-config)模式,能够根据文件类型自动选择合适的分析器。无论是处理 PDF 文档、MP4 视频还是 WAV 音频,只需调用 `md.convert()` 方法,即可将内容转换为 Markdown 文本。对于特定领域的需求,你也可以通过配置自定义分析器来增强提取精度。
MarkItDown 具备智能识别能力,在默认状态下会根据文件类型自动匹配分析器。如果你需要集成更高级的内容理解能力,可以通过 `cu_endpoint` 参数配置内容理解服务的 Endpoint。对于插件功能,默认是关闭的,可以通过参数进行灵活控制。
开发者可以通过 Python API 轻松集成 MarkItDown。基础用法非常简单,只需导入 `MarkItDown` 类并调用 `convert` 方法即可获取转换后的 `text_content`。此外,它还支持集成 Document Intelligence 进行更深度的文档转换,并允许通过 `enable_plugins` 参数来控制插件系统的启用状态。
MarkItDown 拥有灵活的插件系统,支持第三方插件扩展。默认情况下插件处于禁用状态,你可以通过 `markitdown --list-plugins` 查看已安装的插件,并使用 `--use-plugins` 参数在运行时启用它们。开发者也可以参考官方示例编写并贡献自己的第三方插件,通过 GitHub 上的 `#markitdown-plugin` 标签发现更多生态工具。
微软官方维护的高质量工具,与AutoGen和LangChain深度集成,文档转换效果好。是构建AI应用知识库的利器。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,markitdown AI技能包 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | markitdown |
| 原始描述 | 开源AI工具:Python tool for converting files and office documents to Markdown.。⭐123.1k · Python |
| Topics | 文档转换MarkdownOffice处理Python工具AutoGen扩展 |
| GitHub | https://github.com/microsoft/markitdown |
| License | MIT |
| 语言 | Python |
收录时间:2026-05-14 · 更新时间:2026-05-16 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。