A local CLI tool that converts Microsoft Outlook .pst files into AI-friendly formats (Markdown, JSON, or CSV).
- Python 3.8+
- libpst (install via Homebrew on macOS)
brew install libpstNo Python packages needed (stdlib only).
# Metadata-only export (default) - compact, token-efficient
python -m pst_converter.cli your_archive.pst
# Full export with email bodies
python -m pst_converter.cli your_archive.pst --full
# Different formats
python -m pst_converter.cli your_archive.pst -f json
python -m pst_converter.cli your_archive.pst -f csv
python -m pst_converter.cli your_archive.pst -f all # md + json + csv
# Include thread linking info (message IDs, references)
python -m pst_converter.cli your_archive.pst --include-threading
# Preserve folder structure (separate files per folder)
python -m pst_converter.cli your_archive.pst --folders| Option | Description | Default |
|---|---|---|
-f, --format |
markdown, json, csv, both, or all |
markdown |
--metadata-only |
Headers only, no body content (token efficient) | On |
--full |
Include full email bodies | Off |
--include-threading |
Include message_id, in_reply_to, references | Off |
--folders |
Separate files per folder | Off |
-o, --output |
Output directory | ./output |
--limit N |
Limit emails (for testing) | None |
-v, --verbose |
Verbose logging | Off |
| Format | Size | Best For |
|---|---|---|
| Markdown | 668KB | Chat-based AI (most compact) |
| CSV | 1.0MB | Spreadsheets, SQL queries |
| JSON | 1.8MB | Programmatic analysis, structured queries |
Recommendation: Use markdown for pasting into AI chat, JSON for tool-based analysis.
This project is licensed under the MIT License - see the LICENSE file for details.
You can use this as an Agent Skill by copying the pst_converter folder as a skill. This enables AI agents like Claude Code to autonomously convert and analyze PST files.
The pst_converter/ directory contains:
SKILL.md: Instructions that teach Claude how and when to use the tool.cli.py: The main entry point script.- Core logic for extraction and formatting.
To install the PST Converter as a Personal Skill (available everywhere):
Option 1: Symlink (Best for development) Link the folder to your global skills directory:
ln -s "$(pwd)/pst_converter" ~/.claude/skills/pst-converterOption 2: Copy Folder Copy the package into your global skills directory:
cp -r pst_converter ~/.claude/skills/- Verify: In Claude Code, ask: "What skills do you have available?" or "List my skills". You should see
pst-converterin the list. - Use: Simply ask Claude to process a PST file. For example:
- "Convert this archive.pst to markdown"
- "Show me a summary of the emails in backup.pst"
- "Extract the metadata from archive.pst to a JSON file"
Claude will autonomously recognize the task, trigger the skill, and handle the command-line execution for you.
Note: Ensure
libpstis installed on your system, as the skill relies on thereadpstcommand.