NTB WPZ Automation - EMail Downloader
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Email.EmailGetter Class Reference

Used to download emails and parse the attachments from them. More...

Public Member Functions

def __init__ (self, hostname, username, password, download_path='./', max_workers=8)
 
def get_email_list_since_date (self, date)
 Get a list of emails since a given date. More...
 
def download_all_attachments_since_date (self, date)
 Download all attachments in emails since a given date. More...
 
def threaded_download (self, message_number)
 A function to download the attachment from a given email in a thread safe way A single imaplib.IMAP4_SSL is NOT thread safe. More...
 

Static Public Member Functions

def download_attachment_from_email (message, download_path='./')
 Method to parse out the encoded attachment from an email attachment. More...
 

Public Attributes

 client
 
 download_path
 
 hostname
 
 username
 
 password
 
 threads
 

Detailed Description

Used to download emails and parse the attachments from them.

Constructor & Destructor Documentation

◆ __init__()

def Email.EmailGetter.__init__ (   self,
  hostname,
  username,
  password,
  download_path = './',
  max_workers = 8 
)

Member Function Documentation

◆ download_all_attachments_since_date()

def Email.EmailGetter.download_all_attachments_since_date (   self,
  date 
)

Download all attachments in emails since a given date.

Parameters
dateThe datetime.date object representing the date to look back to

◆ download_attachment_from_email()

def Email.EmailGetter.download_attachment_from_email (   message,
  download_path = './' 
)
static

Method to parse out the encoded attachment from an email attachment.

Parameters
messageThe email message object to parse the attachment from
download_pathThe path to download the file to on the disk, ./ by default

◆ get_email_list_since_date()

def Email.EmailGetter.get_email_list_since_date (   self,
  date 
)

Get a list of emails since a given date.

Parameters
dateThe datetime.date object representing the date to look back to

◆ threaded_download()

def Email.EmailGetter.threaded_download (   self,
  message_number 
)

A function to download the attachment from a given email in a thread safe way A single imaplib.IMAP4_SSL is NOT thread safe.

Parameters
message_numberthe number of the message to download the attachment from

Member Data Documentation

◆ client

Email.EmailGetter.client

◆ download_path

Email.EmailGetter.download_path

◆ hostname

Email.EmailGetter.hostname

◆ password

Email.EmailGetter.password

◆ threads

Email.EmailGetter.threads

◆ username

Email.EmailGetter.username

The documentation for this class was generated from the following file: