Sending data by email
To send data by email with dreamcoat you will first need to set up a Gmail account with an app-specific password. This account is used to send the emails and its username goes into the
gmail_username kwarg below.
One specific file
- Yagmail does the work behind the scenes, so see its documentation for more info about the other kwargs.
gmail_username(and password) can optionally be put into the .dreamcoat directory, as can the
All files with given extension
To attach all files with a given path and extension to an email and send it, use
- Only files matching the specified
separatedetermines whether to send each file in a separate email or attach them all to the same one.
Tidy up after sending
After sending the files, you can delete all the files with a given extension from a directory using
Note that this will indiscriminately delete all files in the specified
filepath with the specified
extension - not just the ones you sent! Use
os.remove() if you need to be more selective.