python-oxmsg
Extract attachments from Outlook .msg files.
What it is and what it does
python-oxmsg is a Python library for reading Outlook MSG files and extracting their contents. It parses the binary MSG format (MS-OXMSG) to give you access to message text, metadata like sender and sent date, and any attached files. The library is read-only—it extracts data from existing MSG files but does not support modifying messages or creating new ones from scratch.
The package provides both a programmatic API (via the Message class) and a command-line utility for diagnostic inspection. It depends on click for CLI support, olefile for parsing the OLE2 container format that MSG files use, and typing_extensions for type hints. It supports Python 3.9 through 3.12 and is classified as Alpha, reflecting that it handles the core extraction use case but may not cover all MSG format edge cases.
Use it for:
- Batch extract attachments from a folder of Outlook MSG files for archival or processing.
- Programmatically read email metadata (sender, subject, date) from MSG files in an automation workflow.
- Inspect MSG file structure and properties using the CLI dump command for debugging or forensic analysis.
- Integrate MSG parsing into a document management or email migration tool.
- Extract message text and metadata to index or search Outlook messages outside of Outlook.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses Outlook MSG files to extract email messages, attachments, and message properties like sent date and sender information.
Yes, if you need to read Outlook MSG files and extract attachments or metadata. The package is straightforward, has low install friction, and carries no known security vulnerabilities. The dormant maintenance status (557 days since last release) is a minor concern for a young Alpha project, but the recent repository activity and permissive MIT license make it a reasonable choice for read-only MSG extraction tasks. Not suitable if you need to modify or create MSG files.
Install
python-oxmsg on PyPI
pip
pip install python-oxmsguv
uv add python-oxmsgpoetry
poetry add python-oxmsgInstalling python-oxmsg
Before you install
Low friction install with three lightweight runtime dependencies (click, olefile, typing_extensions). Project is dormant—last release was 557 days ago—but the repository remains active with a recent commit on 2025-02-03.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
pip install python-oxmsg
from oxmsg import Message
msg = Message.load("message.msg")
print(msg.sender)
for attachment in msg.attachments:
with open(attachment.file_name, "wb") as f:
f.write(attachment.file_bytes)
Requires Python 3.9 or later.
Verify before relying
- Whether the package handles all MSG format variants and edge cases reliably, given its Alpha status.
- Performance characteristics when processing large MSG files or many attachments.
- Whether dormancy (557 days since last release) signals maintenance concerns or stable maturity.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — click, olefile, typing_extensions |
| Maintenance | dormant — 557 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,404,958/month — #2,633 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_oxmsg-0.0.2-py3-none-any.whl
Keywords: ms-oxmsg, outlook, email
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
extract-msgExtracts email metadata (from, to, cc, date,…
copyleft · top 5,000 on PyPI
msg-parserParses Microsoft Outlook MSG email files,…
permissive · top 15,000 on PyPI
mail-parserParses raw email messages into structured…
permissive · top 5,000 on PyPI
tnefparseDecodes Microsoft's Transport Neutral…
copyleft · top 15,000 on PyPI
eml-parserParses EML (email) files and extracts…
agpl · top 15,000 on PyPI
rtfparseParses Microsoft Rich Text Format (RTF)…
permissive · top 15,000 on PyPI
RTFDEExtracts encapsulated HTML and plain text…
copyleft · top 5,000 on PyPI
olefileolefile parses, reads, and writes Microsoft…
permissive · top 1,000 on PyPI
mailbitsProvides utilities for parsing, converting, and…
permissive · top 15,000 on PyPI