Convert a file from one format to another in ONE command, picking the right engine from the extensions: Word/PowerPoint/Excel/OpenOffice/HTML/text to PDF; PDF to editable Word; Word to Markdown, HTML or text; Markdown or HTML to Word, PowerPoint or PDF; PowerPoint to PDF or slide images (PNG); Excel to CSV (one per sheet) and CSV to Excel or PDF; images to PDF; JPG/PNG/WEBP between each other. Use for: save this as PDF, turn this PDF into Word, I need this Word file as Markdown, make slides images, export each Excel sheet as CSV, convert these photos to one PDF. Triggers: convert, save as, export as, to PDF, to Word, to Excel, to CSV, to Markdown, to PNG, docx, pptx, xlsx, odt, rtf, html.
Say it in your own words; the assistant finds this recipe by itself. Examples:
Convert a file from one format to another in ONE command, picking the right engine from the extensions: Word/PowerPoint/Excel/OpenOffice/HTML/text to PDF; PDF to editable Word; Word to Markdown, HTML or text; Markdown or HTML to Word, PowerPoint or PDF; PowerPoint to PDF or slide images (PNG); Excel to CSV (one per sheet) and CSV to Excel or PDF; images to PDF; JPG/PNG/WEBP between each other. Use for: save this as PDF, turn this PDF into Word, I need this Word file as Markdown, make slides images, export each Excel sheet as CSV, convert these photos to one PDF. Triggers: convert, save as, export as, to PDF, to Word, to Excel, to CSV, to Markdown, to PNG, docx, pptx, xlsx, odt, rtf, html.
python3 /skills/office-convert/scripts/convert.py IN OUT [--dpi 110] [--pages 1-5] — the route is
chosen from the two extensions. Inputs in /work/in, results in /work/out. Prints one
OK <route> -> OUT (size) line or ERROR ….
| From → to | Example | Engine |
|---|---|---|
| docx, doc, odt, rtf, pptx, odp, xlsx, ods, csv, html, txt → pdf | convert.py /work/in/offer.docx /work/out/offer.pdf |
LibreOffice |
| md → pdf | convert.py /work/in/notes.md /work/out/notes.pdf |
pandoc → LibreOffice |
| pdf → docx | convert.py /work/in/scan.pdf /work/out/scan.docx |
pdf2docx (tables kept; scans need OCR first) |
| pdf → txt | convert.py /work/in/report.pdf /work/out/report.txt |
poppler |
| pdf → png (one per page) | convert.py /work/in/report.pdf /work/out/pages → pages/page-01.png … |
poppler |
| docx, odt, html → md, html, txt | convert.py /work/in/report.docx /work/out/report.md |
pandoc |
| md, html, txt → docx | convert.py /work/in/notes.md /work/out/notes.docx |
pandoc |
| md → pptx | convert.py /work/in/outline.md /work/out/outline.pptx (# = slide title) |
pandoc |
| pptx → png (one per slide) | convert.py /work/in/deck.pptx /work/out/slides → slides/slide-01.png … |
LibreOffice + poppler |
| pptx → txt / md (outline) | convert.py /work/in/deck.pptx /work/out/deck.md |
python-pptx |
| xlsx → csv | convert.py /work/in/book.xlsx /work/out/book.csv (several sheets → book-<sheet>.csv) |
openpyxl |
| csv → xlsx | convert.py /work/in/data.csv /work/out/data.xlsx |
pandas |
| png, jpg, webp, tif → pdf (a folder of images → one PDF) | convert.py /work/in/photos /work/out/photos.pdf |
Pillow |
| png ↔ jpg ↔ webp | convert.py /work/in/logo.webp /work/out/logo.png |
Pillow |
For a NEW document from an outline use deck-builder / docx-writer; for editing an existing deck or document use deck-craft / word-craft; for Markdown from a PDF with OCR use pdf-to-markdown. Give the person the download link(s) from the OK line.
SKILL.mdscripts/__pycache__/convert.cpython-311.pycscripts/convert.pyWritten by Percerno, MIT licence.