How to save an excel file with DataNitro and python
Question
I've got an python script to that generates an excel worksheet from a database query with the DataNitro excel plugin (the free one), now i want so save the file and then send it via email, but the DataNitro docs only includes working with cells and worksheets, is there a method call in the DataNitro API or any other work around to save the file?
Solution
DataNitro founder here - I've just added the functions to save workbooks to the DataNitro API for you. Thanks for point this out! You need to download the latest version of DataNitro from https://www.datanitro.com
Here's the Python 2 code to save a workbook & send it via email: https://github.com/datanitro/blog/blob/master/save_and_email/save_and_send.py
You can find the documentation for save() and save_copy() here: https://datanitro.com/docs.html#sheets
Please let me know what you think. Thanks!
OTHER TIPS
I think you're looking for something like smtplib. This will allow you to send emails and attachments from python.
Find out more here: http://www.blog.pythonlibrary.org/2010/05/14/how-to-send-email-with-python/
Documentation: http://docs.python.org/library/smtplib.html