--- id: extract-msg version: "0.56.1" license: GPL license_treatment: copyleft maintenance: active --- # extract-msg — Extracts emails and attachments saved in Microsoft Outlook's .msg files License: copyleft · Maintenance: active · Downloads: 7.2M/mo ## What it is and what it does extract-msg is a Python library and command-line tool that parses Microsoft Outlook .msg files and extracts their structured email data and attachments. It automates retrieval of standard email fields (from, to, cc, date, subject, body) and saves attachments to disk or other formats. The package handles OLE2 file parsing, Outlook's Extended MAPI property encoding, RTF decompression, and character set conversion through its runtime dependencies including olefile, compressed-rtf, RTFDE, ebcdic, beautifulsoup4, tzlocal, and red-black-tree-mod. You can use it as a standalone CLI tool to batch-process .msg files into organized folder structures, or import it into Python code to programmatically read and transform Outlook messages. It supports output to plain text, HTML, PDF, RTF, raw, and JSON formats, with options to handle embedded messages, hidden attachments, and character set conversion. The package is actively maintained and supports Python 3.8 and above. Use it for: - Batch extract emails and attachments from Outlook .msg files for archival or migration - Convert Outlook messages to HTML or PDF for document management or compliance workflows - Programmatically parse .msg files in a data pipeline to index email metadata or extract structured content - Recover email data from .msg files for forensic analysis or email recovery scenarios - Automate attachment extraction from a folder of .msg files with filtering by attachment type or hidden status ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts email metadata (from, to, cc, date, subject, body) and attachments from Microsoft Outlook .msg files, with support for multiple output formats including HTML, PDF, RTF, and JSON. Yes, if you need to parse Outlook .msg files. The package is actively maintained, has low install friction, and offers both CLI and library interfaces. However, note the GPL copyleft license—verify compatibility with your project's licensing before use in proprietary software. ## Install pip install extract-msg uv add extract-msg poetry add extract-msg ## Installing extract-msg Before you install: Low install friction with a pure-wheel distribution. Actively maintained with a recent release and 852 repository stars. Requires Python 3.8 or above. License in practice: Licensed under GPL (copyleft). Use in proprietary software requires careful review of licensing obligations, as copyleft terms may require derivative works to be open-source. Quickstart: pip install extract-msg import extract_msg msg = extract_msg.openMsg("path/to/file.msg") # Access msg.from_, msg.to, msg.cc, msg.date, msg.subject, msg.body # Or from command line: # python -m extract_msg example.msg Requires Python 3.8 or above. Verify before relying: - Whether all output formats (HTML, PDF, RTF, JSON) are equally well-supported or have known limitations - Performance characteristics when processing large .msg files or batch extraction scenarios - Compatibility with .msg files from different Outlook versions or edge cases in MAPI property structure ## Package facts - License: GPL (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 7.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags outlook msg file extraction, email attachment extractor, msg parser python, extract outlook emails, msg to html converter, email data extraction, outlook message parser, email-parsing, outlook-msg, file-extraction [View on SkillFed](https://skillfed.io/packages/extract-msg) · [View on PyPI](https://pypi.org/project/extract-msg/)