chunklet.document_chunker.processors.eml_processor
Classes:
-
EmlProcessor–Processor class for extracting text and metadata from EML (RFC 822) email files.
EmlProcessor
Bases: BaseProcessor
Processor class for extracting text and metadata from EML (RFC 822) email files.
Text content is extracted from the decoded plain-text body of the email.
This processor focuses on extracting commonly used email header metadata together with the names of attached and inline files. The extracted metadata corresponds to fields available from the parsed mail object returned by the underlying email parser. Not all available message fields are extracted.
For more details on the parsed mail object and the available fields, refer to the MailParser documentation:
https://nodemailer.com/extras/mailparser/#returned-mail-object
Initializes the EmlProcessor with a path to the EML file and parses the email into memory.
Parameters:
-
(file_pathstr) –Path to the EML file.
Methods:
-
extract_metadata–Extracts commonly used email metadata from the parsed message.
-
extract_text–Yields the decoded plain-text body of the email.
Source code in src/chunklet/document_chunker/processors/eml_processor.py
extract_metadata
Extracts commonly used email metadata from the parsed message.
Returns:
-
dict[str, Any]–A dictionary containing metadata fields. - source - subject - from - to - cc - date - message_id - in_reply_to - references - attachment_names - inline_names
Source code in src/chunklet/document_chunker/processors/eml_processor.py
extract_text
Yields the decoded plain-text body of the email.
Yields:
-
str–Plain-text content extracted from the email body.