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

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.2.0.tar.gz (8.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: parse_emails-0.2.0.tar.gz
  • Upload date:
  • Size: 8.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.14.4 Linux/6.6.87+

File hashes

Hashes for parse_emails-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9e733e2e65a6380835ffcd4f85b88468ff5a3e7c486d7f2a9dbc3b1e47438a87
MD5 5af1f98b0b69e46de5abb32e06c1b0d7
BLAKE2b-256 ee7813df492a8ade1161dbd32f6a170630eef5a69daff01356493508d78ea3e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parse_emails-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.14.4 Linux/6.6.87+

File hashes

Hashes for parse_emails-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 494749117356b5b0ab19c67efe7ed2335be9713538d7f69bc632c0976554f935
MD5 4f016ffefa24187d3b1cec32e4be23d6
BLAKE2b-256 0bba6c9ecd9df964e3b62c49a19b83a3fcd74ea0dc7b2a94d8d9f92b59bff690

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.48

2 files

0.1.47

2 files

0.1.46

2 files

0.1.45

2 files

0.1.44

2 files

0.1.43

2 files

0.1.42

2 files

0.1.41

2 files

0.1.40

2 files

0.1.39

2 files

0.1.38

2 files

0.1.37

2 files

0.1.36

2 files

0.1.35

2 files

0.1.34

2 files

0.1.33

2 files

0.1.32

2 files

0.1.31

2 files

0.1.30

2 files

0.1.29

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.0.16

1 file

0.0.15

1 file

0.0.14

1 file

0.0.13

1 file

0.0.12

1 file

0.0.11

1 file

0.0.10

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 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