skillfed

python-oxmsg

Extract attachments from Outlook .msg files.

python-oxmsg v0.0.2 3.4M downloads/30d#2,633 on PyPI18
Permissive license MIT DORMANT released

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-oxmsg

uv

uv add python-oxmsg

poetry

poetry add python-oxmsg

Installing 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

Development Status :: 3 - AlphaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Communications :: EmailTopic :: File FormatsTopic :: Office/Business :: Office SuitesTopic :: Software Development :: Libraries

Tags

outlook msg file parserextract email from msg filesoutlook attachment extractionmsg file reader pythonparse outlook messagesemail attachment extractormsg format parser
email-parsingoutlook-integrationfile-format

More Libraries packages