eml2png package


eml2png.eml2png module

eml2png.eml2png.get_html_str_from_file(file_path, eml_str=None)[source]

Get HTML part from EML file.

Parameters:file_path ([str]) – Input EML file
Keyword Arguments:
 eml_str ([str]) – EML string (default: None)
Returns:EML HTML string
Return type:[str]
eml2png.eml2png.to_png(file_path, html_str=None, config=None, options=None)[source]

Paint the EML to a single PNG image.


file_path ([str]) – EML file path

Keyword Arguments:
  • html_str ([str]) – EML HTML string (default: None)
  • config – imgkit config (default: None)
  • options – imgkit options (default: None)

a PNG byte string.

Return type:


eml2png.skeleton module

This is a skeleton file that can serve as a starting point for a Python console script. To run this script uncomment the following lines in the [options.entry_points] section in setup.cfg:

console_scripts =
eml2png = eml2png.skeleton:run

Then run python setup.py install which will install the command eml2png inside your current environment. Besides console scripts, the header (i.e. until _logger…) of this file can also be used as template for Python modules.

eml2png.skeleton.eml_to_png(input, output=None)[source]

eml_to_png function

  • input (str) – input EML file
  • output (str) – output PNG file (Default: None)

output PNG file path. Return input + ‘.png’ if output is None.

Return type:



Main entry point allowing external calls

Parameters:args ([str]) – command line parameter list

Parse command line parameters

Parameters:args ([str]) – command line parameters as list of strings
Returns:command line parameters namespace
Return type:argparse.Namespace

Entry point for console_scripts


Setup basic logging

Parameters:loglevel (int) – minimum loglevel for emitting messages

Module contents