Parses an email message file and extracts the data from it.
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file parse_emails-0.1.28.tar.gz
.
File metadata
- Download URL: parse_emails-0.1.28.tar.gz
- Upload date:
- Size: 8.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.15 Linux/5.15.154+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6f705437be3812d881c1070012c32bdfe07e6e794552681c8d90914ad91259f |
|
MD5 | 94c658c8f42d1cd275fbc875eb6c6fa7 |
|
BLAKE2b-256 | e6a841327c439b109f7af870bcf86ef6488a79e7adc19ab3b74dfa3f8f5fba5c |
File details
Details for the file parse_emails-0.1.28-py3-none-any.whl
.
File metadata
- Download URL: parse_emails-0.1.28-py3-none-any.whl
- Upload date:
- Size: 8.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a694da147de83c0bccfe2d33f1010f6e290a99c2216ab17baedb7ee4a3de5dfc |
|
MD5 | 8ee6f447742a42d5a2490ff8e2fb1aee |
|
BLAKE2b-256 | 9ac0f819c4f3edceafb692dced1f99c98d392454c74831fcfab9ff6a72f8a5af |