A command-line tool to process documents using the Mistral AI OCR API.
git clone https://github.com/yourusername/mistral-ocr.git
cd mistral-ocr
pip install .git clone https://github.com/yourusername/mistral-ocr.git
cd mistral-ocr
pip install -e .Create a .env file in your working directory with your Mistral API key:
MISTRAL_API_KEY="YOUR_MISTRAL_API_KEY_HERE"
After installation, you can run the tool from anywhere:
mistral-ocr <document_source> [-v/--verbose]Replace <document_source> with either:
- A URL to the document (e.g.,
https://example.com/document.pdf) - A local file path (e.g.,
./my_document.png)
Process a document from a URL:
mistral-ocr https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdfProcess a local file with verbose logging:
mistral-ocr ./invoices/invoice_march.pdf --verboseThe tool prints the extracted text from the document in Markdown format.