Skip to main content

Parses an email message file and extracts the data from it.

Project description

Coverage Status CLA assistant CircleCI

parse-emails

Parses an email message file and extracts the data from it.

The key features are:

  • Supports .eml and .msg files.
  • Extracts nested attachments.

Requirements

Python 3.8.5+

Installation

$ pip install parse-emails
$ brew install libmagic

Usage

The main class EmailParser contains all what you need to parse an email:

import parse_emails

email = parse_emails.EmailParser(file_path=<file_path>, max_depth=3, parse_only_headers=False)
email.parse()
print(email.parsed_email['Subject'])

Inputs

Argument Name Description
file_path* the file_path of a in msg or eml format
parse_only_headers Will parse only the headers and return headers table, Default is False
max_depth How many levels deep we should parse the attached emails (e.g. email contains an emails contains an email). Default depth level is 3. Minimum level is 1, if set to 1 the script will parse only the first level email
file_info the file info

Contributing

Contributions are welcome and appreciated. To contribute you can submit a PR.

Before merging any PRs, we need all contributors to sign a contributor license agreement. By signing a contributor license agreement, we ensure that the community is free to use your contributions.

When you open a new pull request, a bot will evaluate whether you have signed the CLA. If required, the bot will comment on the pull request, including a link to accept the agreement. The CLA document is also available for review as a PDF.

If the license/cla status check remains on Pending, even though all contributors have accepted the CLA, you can recheck the CLA status by visiting the following link (replace [PRID] with the ID of your PR): https://cla-assistant.io/check/demisto/email-parser?pullRequest=[PRID] .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parse_emails-0.1.29.tar.gz (8.8 MB view details)

Uploaded Source

Built Distribution

parse_emails-0.1.29-py3-none-any.whl (8.9 MB view details)

Uploaded Python 3

File details

Details for the file parse_emails-0.1.29.tar.gz.

File metadata

  • Download URL: parse_emails-0.1.29.tar.gz
  • Upload date:
  • Size: 8.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.15 Linux/5.15.154+

File hashes

Hashes for parse_emails-0.1.29.tar.gz
Algorithm Hash digest
SHA256 af98edceec76cd200b7c4db766f9715c9a6ebd638d7914b896b2030a1640ec5b
MD5 e24cc0b380a17222b95312be7b7b48db
BLAKE2b-256 796f7aafbfcc78af9fbf1dcd09014323c7862e6ab2955c0af7e12fafe0dc5f24

See more details on using hashes here.

File details

Details for the file parse_emails-0.1.29-py3-none-any.whl.

File metadata

  • Download URL: parse_emails-0.1.29-py3-none-any.whl
  • Upload date:
  • Size: 8.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.15 Linux/5.15.154+

File hashes

Hashes for parse_emails-0.1.29-py3-none-any.whl
Algorithm Hash digest
SHA256 9e301f04e9c4472ac4e67bee2d4751d9fce20b44f0d41684cf0fa687f83545ba
MD5 20fea4943aac30bc5f9fdc114ffb0a0e
BLAKE2b-256 83c4858b3552ef478bf5384e04d46e2f7e782fdea022e51bbd6dd1cf6cc05f4b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page