Tristan Manchester

Mistral PDF OCR

Officev1.0.0
By Tristan ManchesterUpdated 2026-05-11extracting-mistral-ocr@clawhub_tristanmanchester/extracting-mistral-ocr
PDF#OCR#Document#PDF

According to AlphaMoat, as of 2026-09, Mistral PDF OCR has 1,333 downloads and 0 stars — ranked #4,875 of 5,078 AI skills overall, and #405 of 435 in Office.

Installs
159
Downloads
1.3K
Stars
-
Overall Rank
#4,875
Top 97% overall · Top 94% in Office
PlatformInstallsDownloadsStarsComments
ClawHub ↗331.2K--
SkillHub ↗1591.3K-—

Platforms count differently and update at different times.

What this skill does

It supports scanned-PDF OCR, Markdown conversion and structured extraction. Documents go to Mistral and outputs need a controlled directory; malformed responses may escape the target path, and mistralai should be pinned. Requires Python, MISTRAL_API_KEY, and a vetted pinned SDK. Fix and verify output filename containment before writing artifacts; choosing a directory alone does not resolve it. Treat uncertain structured fields as null and verify extraction quality.

Profile published 2026-10-27

What you can do with it

  • OCR scanned PDFs
  • Convert content to Markdown or structured data

When to use it

  • When transmission is approved and output paths checked

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Review transmission approval and the output-containment fix first; after both pass, extract the table into the approved directory.

Monthly Trend

Downloads1.3K
5589741.4K2026-03 · Downloads 6152026-05 · Downloads 8012026-06 · Downloads 8772026-07 · Downloads 1.0K2026-08 · Downloads 1.1K2026-09 · Downloads 1.3K26-0326-09
Stars-
0112026-03 · Stars -2026-05 · Stars -2026-06 · Stars -2026-07 · Stars -2026-08 · Stars -2026-09 · Stars -26-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-091.3K—-
2026-081.1K+9.4%-
2026-071.0K+17.7%-
2026-06877+9.5%-
2026-05801—-
2026-03615—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.1 KB · ClawHub v1.0.0
---
name: extracting-mistral-ocr
description: >-
  Extracts text, tables, and images from PDFs (including scanned PDFs) using the Mistral OCR API.
  Use when user asks to OCR a PDF/image, extract text from a PDF, parse a scanned document,
  convert a PDF to Markdown, or extract structured fields from a document.
compatibility: >-
  Requires network access and a MISTRAL_API_KEY environment variable. Expects Python 3.9+ and the mistralai package.
allowed-tools: "Read,Write,Bash(python:*)"
metadata:
Show all (80 lines)
  author: generated-by-chatgpt
  version: 0.1.0
  api: mistral
  default-model: mistral-ocr-latest
---

# Mistral OCR PDF extraction

## Quick start (default)

Run the bundled script to OCR a local PDF and write Markdown + JSON outputs:

```bash
python {baseDir}/scripts/mistral_ocr_extract.py --input path/to/file.pdf --out out/ocr
```

Output directory layout:

- `combined.md` (all pages concatenated)
- `pages/page-000.md` (per-page markdown)
- `raw_response.json` (full OCR response)
- `images/` (decoded embedded images, if requested)
- `tables/` (separate tables, if requested)

## Workflow

1. **Pick input mode**
   - **Local PDF** (most common): upload via Files API, then OCR via `file_id`.
   - **Public URL**: OCR directly via `document_url`.

2. **Choose output fidelity** (defaults are safe for RAG)
   - Keep `table_format=inline` unless the user explicitly wants tables split out.
   - Set `--include-image-base64` when the user needs figures/diagrams extracted.
   - Use `--extract-header/--extract-footer` if header/footer noise hurts downstream search.

3. **Run OCR**
   - Use `scripts/mistral_ocr_extract.py` to produce a deterministic on-disk artefact set.

4. **(Optional) Structured extraction from the whole document**
   - If the user wants fields (invoice totals, contract parties, etc.), provide an annotation prompt.
   - The OCR API can return a document-level `document_annotation` in addition to page markdown.

   Example:

   ```bash
   python {baseDir}/scripts/mistral_ocr_extract.py \
     --input invoice.pdf \
     --out out/invoice \
     --annotation-prompt "Extract supplier_name, invoice_number, invoice_date (ISO-8601), currency, total_amount. Return JSON." \
     --annotation-format json_object
   ```

## Decision rules

- **If the PDF is local and not publicly accessible**, upload it (the script does this automatically).
- **If the PDF URL is private or requires authentication**, do not pass it as `document_url`; upload instead.
- **If output quality is critical**, prefer `table_format=html` for downstream parsing over brittle regex.

## Common failure modes

- **Missing `MISTRAL_API_KEY`**: set it in the environment before running.
- **URL OCR fails**: the URL likely is not publicly accessible; upload the file.
- **Large files**: upload supports large files, but very large PDFs may need page selection (`--pages`) or batch processing.

## References

- API + parameters: `references/mistral_ocr_api.md`
- Output mapping rules (placeholders to extracted images/tables): `references/output_mapping.md`
- Example annotation prompts for common document types: `references/annotation_prompts.md`

Popular in Office

More from Tristan Manchester

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.