Skip to main content

Bake slide-deck PDFs into page-by-page Markdown with OCR and optional translation.

Project description

slidebake

slidebake turns slide-deck PDFs, including image-only PDFs exported from PowerPoint, into page-by-page Markdown. It uses local OCR first, then asks the OpenAI API to clean OCR noise into polished Markdown, with optional translation for each page.

Install

slidebake should be installed with Python 3.12. One of its OCR dependencies does not currently support newer Python versions.

pip install slidebake

For local development:

uv venv --python 3.12
uv sync
uv run slidebake --help

Usage

slidebake slides.pdf
# cleans OCR into slides.md

slidebake slides.pdf --target-lang zh-CN
# cleans OCR, translates it, and writes slides_zh-CN_translated.md

slidebake slides.pdf --target-lang zh-CN --bilingual
# cleans OCR, then writes source text plus zh-CN in slides_zh-CN_bilingual.md

Use -o/--output to choose an exact output path instead.

LLM cleanup and translation require:

export OPENAI_API_KEY="your_api_key_here"

You can also put OpenAI or OpenAI-compatible provider settings in ~/.config/slidebake/config.toml:

[openai]
api_key = "your_api_key_here"
model = "gpt-5.4-mini"
api = "responses"

For providers that expose an OpenAI-compatible Chat Completions endpoint:

[openai]
api_key = "provider_api_key"
base_url = "https://api.example.com/v1"
model = "provider-model"
api = "chat_completions"

Command-line options and SLIDEBAKE_OPENAI_* environment variables override the config file. Use --config path/to/config.toml to load a different config file.

Useful options:

  • --pages 1-10,15 limits processing to specific pages.
  • --dpi 220 changes render resolution for OCR.
  • --model gpt-5.4-mini changes the OpenAI model.
  • --openai-base-url https://api.example.com/v1 uses an OpenAI-compatible endpoint.
  • --openai-api chat_completions uses the Chat Completions compatibility path.
  • --check-key checks resolved OpenAI-compatible settings without processing a PDF.
  • --keep-temp keeps rendered page images for debugging.
  • --overwrite replaces an existing output file.

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

slidebake-0.1.2.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

slidebake-0.1.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file slidebake-0.1.2.tar.gz.

File metadata

  • Download URL: slidebake-0.1.2.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for slidebake-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c8e312f5e43d75cc63bad39fa6dbc21e23f38446c43e5ac051c7e294371ac9fa
MD5 d58eeadcf23681846403497547783fa8
BLAKE2b-256 c530ef97bf38124f0a6f2688886e732fb3843693304cc3c5118eeab57f9a47c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for slidebake-0.1.2.tar.gz:

Publisher: publish.yml on heyifan142857/slidebake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file slidebake-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: slidebake-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for slidebake-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c011008e41b540871edb476d8632053231abb50fc03f0a3255fe1e2fd5c4ee
MD5 33e1a80838ae2765a26536399eb860c8
BLAKE2b-256 ac6d6d5b57032877e259efe6673040f00a833f8a8101e28c2fe1375ded2d7173

See more details on using hashes here.

Provenance

The following attestation bundles were made for slidebake-0.1.2-py3-none-any.whl:

Publisher: publish.yml on heyifan142857/slidebake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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