parse-emails
Parses an email message file and extracts the data from it.
The key features are:
- Supports
.emland.msgfiles. - Extracts nested attachments.
Requirements
Python 3.11+
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] .
Metadata
Release files for parse-emails 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| parse_emails-0.2.1.tar.gz | 8.9 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| parse_emails-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.8 MB
Release files / parse_emails-0.2.1.tar.gz
| Download URL | parse_emails-0.2.1.tar.gz |
|---|---|
| Size | 8.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbf83d22c3474588a84698227f09652bc36bc814715844aa6929aa5136be3d8b
|
|
BLAKE2b-256 checksum How to use checksums |
8de760f798e7255fa230d766fc066be48cbc3eb0db6a941795df8913ef0420bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.14.4 Linux/6.6.87+
|
Release files / parse_emails-0.2.1-py3-none-any.whl
| Download URL | parse_emails-0.2.1-py3-none-any.whl |
|---|---|
| Size | 8.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e8080c9f51316746f8a6b632760f6f8bfdb898a40377459e3fe43ce95cc6619
|
|
BLAKE2b-256 checksum How to use checksums |
817acb2192b348a72e225829fd67a880e3bc671383ca456521d7fcadecd9c59e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.14.4 Linux/6.6.87+
|
Security for parse-emails 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.