Skip to main content

email imap client for downloading email data files

Project description

NRGPy data_email_client

data_email_client is a Python package for downloading data files from emails using the imap protocol (SSL-compatible)

installation

pip install data_email_client

examples

see script docstrings for more usage info.

spidar data files:

>>> from data_email_client import mailer
>>> from getpass import getpass
>>> server = 'outlook.office365.com' # 'imap.gmail.com' for gmail
>>> username = 'data-email@my-domain.com'
>>> password = getpass()
...
>>> imap = mailer(server=server, username=username, password=password)
>>> data_boxes = [m for m in imap.mailboxes if 'data' in m]
>>> imap.search_for_messages(text='spidardatanotification@nrgsystems.com', area='from', folder=data_boxes)
>>> imap.download_attachments(out_dir='/path/to/data/', extension='csv', delete=False)

symphonie data emails

...
>>> body_text = 'SymphoniePRO Logger data attached.' # 'Wind Data attached.' for older logger types
>>> imap = mailer(server=server, username=username, password=password)
>>> data_boxes = [m for m in imap.mailboxes if 'data' in m]
>>> imap.search_for_messages(text=body_text, area='body', folder=data_boxes)
>>> imap.download_attachments(
        out_dir='/path/to/data/', 
        extension='rld', 
        delete=False, 
        archive_folder='INBOX/Archive'
    )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

data_email_client-0.1.6-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page