eml2png package¶
Submodules¶
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.
Parameters: 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)
Returns: a PNG byte string.
Return type: [bytes]
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
Parameters: Returns: output PNG file path. Return input + ‘.png’ if output is None.
Return type:
-
eml2png.skeleton.
main
(args)[source]¶ Main entry point allowing external calls
Parameters: args ([str]) – command line parameter list
-
eml2png.skeleton.
parse_args
(args)[source]¶ Parse command line parameters
Parameters: args ([str]) – command line parameters as list of strings Returns: command line parameters namespace Return type: argparse.Namespace