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.2.0.tar.gz (28.7 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.2.0-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mark_everything-0.2.0.tar.gz
  • Upload date:
  • Size: 28.7 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.2.0.tar.gz
Algorithm Hash digest
SHA256 26b0f559594b67ed1fe179ce2160bc3952ed30c64a48045f445fec93b475ad47
MD5 4955768f2bea765d96f19f35df84f69e
BLAKE2b-256 a08c24b10784473b4e26f4ec321bf94fee0e3daf479fd6dc460b96173b0f4502

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mark_everything-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4ae36919c85d2c2539c867a59f0fac72ddad0b8aeb2ef4878cb1c4624811e62
MD5 4ce1daa07e958bc803e0d42cfd22ca84
BLAKE2b-256 634dc1782052727d133e0ead55fa3b8e8946c2a0f411c15fda7ccb9bd414e89c

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