CLI tool to convert PDFs to markdown using Mistral OCR
Project description
Mistral OCR PDF
CLI tool to convert PDFs to markdown using Mistral OCR.
Installation
pip install mistral-ocr-pdf
# or with uv
uv pip install mistral-ocr-pdf
Usage
Convert a PDF to markdown:
mistral-ocr-pdf input.pdf
# Output will be saved as input.md
Specify output file:
mistral-ocr-pdf -o output.md input.pdf
Save raw OCR response JSON for debugging:
mistral-ocr-pdf --output-json response.json input.pdf
API Key Configuration
The Mistral API key can be configured in three ways:
-
Environment variable:
export MISTRAL_API_KEY="sk-xxxx" mistral-ocr-pdf input.pdf
-
Config file:
mistral-ocr-pdf -sk api_key -sv "sk-xxxx" # This saves the key to ~/.config/mistral_ocr_pdf/config.json
-
Direct config file editing: Create or edit
~/.config/mistral_ocr_pdf/config.jsonwith:{ "api_key": "sk-xxxx" }
Run with uv
You can also run the tool directly with uvx:
uvx mistral-ocr-pdf input.pdf
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mistral_ocr_pdf-0.1.0.tar.gz.
File metadata
- Download URL: mistral_ocr_pdf-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c233c5e594d31dfeca04191d2f41ed94e48b9c069c59cf116d0d622d7ada47e
|
|
| MD5 |
ce3331d293f72fad37a0005c6a63880d
|
|
| BLAKE2b-256 |
4a1f5ce85c79acfec35ef2a500f5cd3aba105bb25f1da971443680bba1ebdf76
|
File details
Details for the file mistral_ocr_pdf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mistral_ocr_pdf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9caf329be2b6170b75c52760b33b7ad2fb40bee701798f3319c05fb59b7ba5b9
|
|
| MD5 |
f6f3c7f457d67b40a0a611263d74b91a
|
|
| BLAKE2b-256 |
d1ec51b06fa23c35829a007f89d84da992edbe5055074cd685ebb561421d284f
|