DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to extract invoice fields into YAML front matter with Markitdown

Route PDFs through Azure Content Understanding or Document Intelligence to get structured fields with the Markdown.

Short answer: Install the extra with pip install 'markitdown[az-content-understanding]'; then set the MARKITDOWN_CU_ENDPOINT environment variable once to your Content Understanding endpoint; Convert with markitdown path-to-file.pdf --use-cu. All steps.

  • Research
  • Advanced
  • 1 hour
  • From the README
  • Claude Code
  • Codex
  • Cursor

cost. Each convert() call routed to Content Understanding or Document Intelligence is a billable Azure API call, and some add-ons cost extra.

Who it is forAn operations person who wants vendor names, dates and totals out of invoices as data, not just text.

The problemPlain conversion gives you text, but a workflow needs specific fields in a predictable place.

The outcomeMarkdown with YAML front matter holding the extracted fields, ready for a script or an agent to read.

What you need first

  • Python 3.10 through 3.14, ideally in a virtual environment
  • Optional dependency groups for each format, or [all] for everything
  • Optional: an OpenAI-compatible client for image descriptions and the markitdown-ocr plugin
  • Optional: an Azure Document Intelligence or Content Understanding resource, which is billed per call

Steps

  1. Install the extra with pip install 'markitdown[az-content-understanding]'
  2. Set the MARKITDOWN_CU_ENDPOINT environment variable once to your Content Understanding endpoint
  3. Convert with markitdown path-to-file.pdf --use-cu
  4. For domain fields, pass a custom analyzer such as cu_analyzer_id="my-invoice-analyzer" in Python and read the fields block
  5. Use cu_file_types to send only PDFs to the cloud, since every routed convert() call is billed

Prompt for your agent

Using microsoft/markitdown with Azure Content Understanding, convert the invoices in <folder> to Markdown with structured fields. Restrict cloud routing to PDFs with cu_file_types and give me a table of VendorName and InvoiceDate from the front matter.

Caveat. You need your own Azure resource; the README links to setup docs rather than walking through it.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for microsoft/markitdown and "Extract invoice fields into YAML front matter"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer