Skip to main content

Convert any document (.docx, .pptx, .xlsx, .eml, .msg, .pdf) to clean Markdown.

Project description

MarkEverything

Convert any Office document or email into clean, structured Markdown — preserving headings, tables, images, diagrams, and meaning.

Format What is extracted
.docx Headings, paragraphs, bold/italic, tables, hyperlinks, embedded images, SmartArt → Mermaid, OML equations → LaTeX
.pptx Per-slide sections, spatial reading order, connected shapes → Mermaid, embedded images, speaker notes
.xlsx Sheet tables (used-range only), bold cells, Bar/Pie charts → Mermaid
.eml YAML frontmatter headers, HTML/plain body, inline images, attachment list
.msg Same as .eml via extract-msg

Requirements

  • Python 3.10+
  • See requirements.txt for library dependencies

Installation

From source (development)

git clone https://github.com/your-org/mark-everything.git
cd mark-everything
pip install -e ".[dev]"

Runtime only

pip install -e .

With .msg support

pip install -e ".[msg]"

Quick Start

Python API

from mark_everything import convert
from mark_everything.models import ConversionConfig, ImageMode, MermaidDepth

# Minimal — all defaults (images embedded as base64)
result = convert("report.docx")
print(result.markdown)

# Full config
config = ConversionConfig(
    image_mode=ImageMode.PATH,       # save images to disk
    output_dir="output/assets",      # where to save them
    mermaid_depth=MermaidDepth.FULL, # attempt complex SmartArt
    exclude_sheets=["Internal"],     # skip this Excel sheet
    include_speaker_notes=True,      # include PPT speaker notes
)
result = convert("presentation.pptx", config)

# Inspect result
print(result.markdown)           # the Markdown string
print(result.asset_paths)        # list[Path] of saved images
print(result.warnings)           # list[str] of non-fatal issues

Command-Line Interface

# Basic — print Markdown to stdout
mark-everything report.docx

# Write to file
mark-everything report.docx -o output/report.md

# Save images as files instead of base64
mark-everything report.docx --image-mode path --output-dir output/assets -o output/report.md

# PowerPoint — omit speaker notes
mark-everything deck.pptx --no-speaker-notes -o output/deck.md

# Excel — skip certain sheets, full SmartArt depth
mark-everything data.xlsx --exclude-sheets Internal Scratch --mermaid-depth full -o output/data.md

# Verbose logging
mark-everything email.eml -v -o output/email.md

Configuration Reference

Option Type Default Description
image_mode "base64" | "path" "base64" Embed images as data-URIs or save to disk
output_dir Path | None None Asset directory when image_mode="path"
mermaid_depth "simple" | "full" "simple" SmartArt / connected-shape conversion depth
exclude_sheets list[str] [] Excel sheet names to skip
include_speaker_notes bool True Include PPT speaker notes as > blockquotes

Project Structure

mark_everything/
├── __init__.py          # Public API: convert()
├── engine.py            # Central router
├── models.py            # Pydantic config + result models
├── media.py             # Image encode / save helpers
├── mermaid.py           # Mermaid diagram builder
├── cli.py               # CLI entry-point
└── converters/
    ├── docx.py          # Word converter
    ├── pptx.py          # PowerPoint converter
    ├── xlsx.py          # Excel converter
    └── email.py         # Email (.eml / .msg) converter

Design Principles

  • Pure functions — all helpers are stateless; same input always yields same output.
  • Pydantic modelsConversionConfig is validated and frozen; ConversionResult is immutable.
  • Structured logginglogging.getLogger(__name__) throughout; no print() in library code.
  • No memory leaks — all file handles and workbooks are opened inside with / try-finally blocks.
  • PEP 8 compliant — enforced via ruff (configured in pyproject.toml).
  • Lazy imports — heavy converters are only imported when the file type is actually needed.

License

MIT

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

mark_everything-0.1.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

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

mark_everything-0.1.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mark_everything-0.1.0.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for mark_everything-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8789d68b08220cf53f26a2788ea0fd04efdb0885b1c7ae0b4df092eae198e95c
MD5 b3aa9962952fc768cdbce9649525f529
BLAKE2b-256 5e2a5b3d93b666276a55b574eefdc2d761999ef4b8f98e7c2e42a0bcb9c84c2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mark_everything-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 601e1b469f75e8b442028ebb6092f04defe4cdaf39a2447aa4b15fa51f56c1f6
MD5 0feddce3afc206a807b5f2be750a7117
BLAKE2b-256 950442de879d326e7ae6d6632c2c37e24ce1a3ce83f1f96be781adc1c7ad2cfb

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