Skip to main content

Convert PDF recipes to .melarecipe format using Mistral OCR

Project description

pdf2mela

Convert scanned PDF recipes to Mela format using Mistral OCR.

  • Single PDF → .melarecipe (JSON)
  • Multiple PDFs → .melarecipes (ZIP)

Requirements

Installation

git clone git@github.com:jjakubassa/pdf2mela.git
cd pdf2mela
uv sync

Usage

# Single file
uv run pdf2mela --inputs recipe.pdf

# Multiple files
uv run pdf2mela --inputs recipe1.pdf recipe2.pdf

# Whole directory
uv run pdf2mela --inputs ./scans/

# Custom output directory
uv run pdf2mela --inputs ./scans/ --output ./mela/

# Explicit API key
uv run pdf2mela --inputs recipe.pdf --api-key YOUR_KEY

The Mistral API key is read from the MISTRAL_API_KEY environment variable by default.

Pricing

Mistral OCR costs $2 per 1,000 pages. The tool prints an estimated cost at the end of each run, including what it would have cost with the 50% batch discount.

Notes

  • Recipes are extracted in their original language — no translation is applied.
  • All PDFs in a run are processed concurrently.
  • Failed requests are retried up to 3 times with exponential backoff.
  • Set LOGLEVEL=DEBUG to see raw OCR responses.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf2mela-0.1.0.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf2mela-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file pdf2mela-0.1.0.tar.gz.

File metadata

  • Download URL: pdf2mela-0.1.0.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for pdf2mela-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ce3dd5c3b86bff8e0f59256bc1af46ead01826aceb28a55de6a38385c604b732
MD5 1a065e7849fe685e77578400fec6ffb9
BLAKE2b-256 efa314fa14b713eb6dbab1feb4cdff856270e96935e480e84a1888361fd448d6

See more details on using hashes here.

File details

Details for the file pdf2mela-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pdf2mela-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for pdf2mela-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c4f1fae3a76d52c53d914de2e59dfd3372acb75412d6b7d1da3d2232a508e22
MD5 32258748bcf6586a15e4f95ba97e026d
BLAKE2b-256 9271e0a3109b4c381849e560071203cdc651af004169e1297cc778320f5e9fe6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page