Repository navigation
v0.1.0
ofdkit 的第一个版本:用 Python 读取 OFD 文件(GB/T 33190),提取文字和电子发票字段,并接入 AI 工具。
The first release: read OFD documents (GB/T 33190) in Python, extract text and e-invoice fields, and use them from AI tools.
pip install ofdkit # 核心,无依赖 / core, no dependencies
pip install "ofdkit[mcp]" # MCP 服务器 / MCP server
pip install "ofdkit[markitdown]" # MarkItDown 插件 / MarkItDown pluginAdded
- Read OFD documents with only the Python standard library: pages, templates, page blocks and composite graphic units, tolerant of common producer bugs (absolute or wrongly cased paths, GBK names and encodings, broken XML prefixes).
- Text extraction in reading order, as plain text or Markdown.
- Invoice fields from e-invoices (数电票 and 增值税电子发票), from XML attachments, custom tags and OFD.xml metadata, with amounts and dates normalised and a warning when totals do not add up.
- Command line:
ofdkit info,text,invoice,batch(CSV for Excel, duplicate invoice numbers flagged) andmcp. - MCP server for AI tools, read-only, with an optional folder restriction.
- MarkItDown plugin.
- The
ofd-readerAgent Skill.
Tested on every commit against the shared ofd-samples files. Most of the code was written with AI assistance (Claude); see the README.