Skip to main content

Coverage Status CLA assistant

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.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)

Source distribution for parse-emails 0.2.1
File Size Uploaded
parse_emails-0.2.1.tar.gz 8.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for parse-emails 0.2.1
File Interpreter ABI Platform
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+

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.46

2 release files

0.1.45

2 release files

0.1.44

2 release files

0.1.43

2 release files

0.1.42

2 release files

0.1.41

2 release files

0.1.40

2 release files

0.1.38

2 release files

0.1.37

2 release files

0.1.33

2 release files

0.1.31

2 release files

0.1.28

2 release files

0.1.27

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page