1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.
eml_parser serves as a python module for parsing eml files and returning various information found in the e-mail as well as computed information.
Extracted and generated information include but are not limited to:
attachments - hashes - names
from, to, cc
received servers path
subject
list of URLs parsed from the text content of the mail (including HTML body/attachments)
Please feel free to send me your comments / pull requests.
Install the latest version using pip:
pip install eml-parser
Example on how to use:
import eml_parser
def json_serial(obj):
if isinstance(obj, datetime.datetime):
serial = obj.isoformat()
return serial
with open('sample.eml', 'rb') as fhdl:
raw_email = fhdl.read()
parsed_eml = eml_parser.eml_parser.decode_email_b(raw_email)
print(json.dumps(parsed_eml, default=json_serial))
Which gives for a minimalistic EML file something like this:
{
"body": [
{
"content_header": {
"content-language": [
"en-US"
]
},
"hash": "6c9f343bdb040e764843325fc5673b0f43a021bac9064075d285190d6509222d"
}
],
"header": {
"received_src": null,
"from": "john.doe@example.com",
"to": [
"test@example.com"
],
"subject": "Sample EML",
"received_foremail": [
"test@example.com"
],
"date": "2013-04-26T11:15:47+00:00",
"header": {
"content-language": [
"en-US"
],
"received": [
"from localhost\tby mta.example.com (Postfix) with ESMTPS id 6388F684168\tfor <test@example.com>; Fri, 26 Apr 2013 13:15:55 +0200"
],
"to": [
"test@example.com"
],
"subject": [
"Sample EML"
],
"date": [
"Fri, 26 Apr 2013 11:15:47 +0000"
],
"message-id": [
"<F96257F63EAEB94C890EA6CE1437145C013B01FA@example.com>"
],
"from": [
"John Doe <john.doe@example.com>"
]
},
"received_domain": [
"mta.example.com"
],
"received": [
{
"with": "esmtps id 6388f684168",
"for": [
"test@example.com"
],
"by": [
"mta.example.com"
],
"date": "2013-04-26T13:15:55+02:00",
"src": "from localhost by mta.example.com (postfix) with esmtps id 6388f684168 for <test@example.com>; fri, 26 apr 2013 13:15:55 +0200"
}
]
}
}
Metadata
Release files for eml-parser 1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
File added late
1 file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release files before installing.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| eml_parser-1.7.tar.gz | 16.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eml_parser-1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.4 kB
Release files / eml_parser-1.7.tar.gz
| Download URL | eml_parser-1.7.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff75959ab644cf6c4e40023c146280ddfad639d6733f41e55ae2cf904d07ddcb
|
|
BLAKE2b-256 checksum How to use checksums |
143b1488d86e2e4e0c7b4d05d864457a6139295a134ca5ffb2c7c3f1cd15bea1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / eml_parser-1.7-py3-none-any.whl
File added late
This file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release file before installing.
| Download URL | eml_parser-1.7-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64399824354735d3a8b6acd70b8a0e9f7fdb932609397838b5f21bfece25ed58
|
|
BLAKE2b-256 checksum How to use checksums |
f19831b9c559378548deebb46232f273534f8a85572d09f1a215527f437280cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |