Skip to content

Export Formats

MailAtlas can export a stored document as JSON, Markdown, HTML, or PDF.

Use mailatlas get <document-id> --format ... from the CLI, or atlas.export_document(...) from Python.

FormatUse when
JSONAnother program needs normalized fields, metadata, provenance, and asset references.
MarkdownA person, notebook, retrieval index, or model prompt needs readable text with local asset references.
HTMLLayout, hierarchy, images, or visual inspection matter.
PDFYou need a portable review artifact or archive snapshot.
Terminal window
mailatlas get <document-id> \
--format json \
--out ./document.json

Use JSON when another program needs normalized fields, metadata, source provenance, and asset references.

If --out is omitted, JSON is printed to stdout.

Terminal window
mailatlas get <document-id> \
--format markdown \
--out ./document-markdown

When --out points to a directory, MailAtlas writes a Markdown bundle:

document-markdown/
document.md
assets/

Use Markdown bundles for AI workflows, retrieval indexes, notebooks, reviews, and cases where readable text plus local asset references matter.

If --out is omitted, Markdown is printed to stdout with local asset references.

Terminal window
mailatlas get <document-id> \
--format html \
--out ./document.html

Use HTML when layout, hierarchy, or visual structure matters. HTML exports can rewrite asset references for the output destination.

Terminal window
mailatlas get <document-id> \
--format pdf \
--out ./document.pdf

PDF export uses local Chrome or Chromium.

If MailAtlas cannot find the browser:

Terminal window
export MAILATLAS_PDF_BROWSER="/path/to/chrome-or-chromium"

If --out is omitted, MailAtlas writes to .mailatlas/exports/<document-id>.pdf.

pdf_path = atlas.export_document(
"<document-id>",
format="pdf",
)

Supported formats are json, markdown, html, and pdf.

export_document(...) returns a string. When a file or bundle is written, the string is the output path.

Exports can contain raw email content, attachments, inline images, BCC-related audit metadata, or rendered PDFs. Review exports before sharing them outside your machine or repository.