Metadata-Version: 2.4
Name: emlmailreader
Version: 1.0.4
Summary: Parse EML file and export the information extracted as JSON.
Author-email: Mahesh Kumaar Balaji <mahbalaji@outlook.com>
License: Copyright (c) 2018 The Python Packaging Authority
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/codadel/EMLMailReader
Project-URL: Issues, https://github.com/codadel/EMLMailReader/issues
Keywords: email,reader,eml,parser
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

![EMLMailReader logo](https://static.citadelofcode.com/emlmailreader/logo.png)

![PyPI version](https://img.shields.io/pypi/v/EMLMailReader.svg) ![Static Badge](https://img.shields.io/badge/powered_by-Codadel-orange)

## Overview

EMLMailReader is a comprehensive Python library designed to parse and extract information from EML (Email Message Format) files. The library provides a robust solution for reading email files, extracting headers, body content, attachments, and handling complex MIME structures with support for various encoding formats.

## Key Features

- **Complete EML Parsing**: Parse standard EML files with full MIME support
- **Multi-part Message Support**: Handle complex email structures with nested MIME parts
- **Attachment Extraction**: Extract and save file attachments with proper metadata
- **Encoding Support**: Decode Base64, Quoted-Printable, and other transfer encodings
- **Address Parsing**: Parse and manage email addresses with display names
- **Logging Integration**: Comprehensive logging for debugging and monitoring
- **Exception Handling**: Custom exceptions for specific error scenarios

## Quick Start

### Installation

```bash
pip install emlmailreader
```

### Basic Usage

```python
from EMLMailReader import MailReader, LoggingMode

# Initialize the mail reader
reader = MailReader(logging_mode=LoggingMode.CONSOLE)

# Parse an EML file
message = reader.get_email("/path/to/email.eml")

if message:
    # Access basic email information
    print(f"From: {message.From}")
    print(f"Subject: {message.Subject}")
    print(f"Date: {message.Date}")

    # Access recipients
    print(f"To: {message.To}")
    print(f"Cc: {message.Cc}")

    # Access body content
    print(f"Body: {message.Body}")

    # Check for attachments
    if message.Attachments.length() > 0:
        print(f"Found {message.Attachments.length()} attachments")

        # Save attachments to a folder
        message.save_attachments("/path/to/output/folder")

    # Export message as JSON
    json_data = message.export_as_json()
    print(json_data)
```

## License

This library is distributed under the terms specified in the LICENSE file.

## Support

For issues, questions, or contributions, please refer to the project repository.
