Skip to content

Base

EmailParseBase

Source code in Docs2KG/parser/email/base.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class EmailParseBase:
    def __init__(self, email_file: Path, output_dir: Path = None):
        """
        Initialize the EmailParseBase class

        Args:
            email_file (Path): Path to the email file, end with .eml
            output_dir (Path): Path to the output directory where the converted files will be saved
        """
        self.email_file = email_file

        self.output_dir = output_dir
        if self.output_dir is None:
            email_output_folder = DATA_OUTPUT_DIR / email_file.name
            email_output_folder.mkdir(parents=True, exist_ok=True)

            self.output_dir = email_output_folder

__init__(email_file, output_dir=None)

Initialize the EmailParseBase class

Parameters:

Name Type Description Default
email_file Path

Path to the email file, end with .eml

required
output_dir Path

Path to the output directory where the converted files will be saved

None
Source code in Docs2KG/parser/email/base.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def __init__(self, email_file: Path, output_dir: Path = None):
    """
    Initialize the EmailParseBase class

    Args:
        email_file (Path): Path to the email file, end with .eml
        output_dir (Path): Path to the output directory where the converted files will be saved
    """
    self.email_file = email_file

    self.output_dir = output_dir
    if self.output_dir is None:
        email_output_folder = DATA_OUTPUT_DIR / email_file.name
        email_output_folder.mkdir(parents=True, exist_ok=True)

        self.output_dir = email_output_folder