从JupyterLab发送电子邮件
项目描述
jupyterlab_email
一个JupyterLab扩展,可以从浏览器发送notebook电子邮件。
选项
- 将内联notebook作为带有代码的电子邮件发送
- 将内联notebook作为不带代码的电子邮件发送
- 将notebook作为带有代码的HTML附件发送
- 将notebook作为不带代码的HTML附件发送
- 将notebook作为带有代码的PDF附件发送
- 将notebook作为不带代码的PDF附件发送
- 将输出数据附加为CSV、TSV、PDF、PNG或Excel电子表格
安装
pip install jupyterlab_email
jupyter labextension install jupyterlab_email
jupyter serverextension enable --py jupyterlab_email
添加模板
安装服务器扩展,并将以下内容添加到 jupyter_notebook_config.py
c.JupyterLabEmail.smtp_servers = [{'name': 'gmail',
'domain': 'gmail.com',
'username': '<YOUR USERNAME>',
'smtp': 'smtp.gmail.com',
'port': 465}]
从notebook创建电子邮件
使用 jupyterlab_email._email
中的函数
def make_email(path, model, from_, type='email', template='', code=False, subject='',
also_attach='none', also_attach_pdf_template='', also_attach_html_template=''):
'''
path : path to notebook
model : notebook itself (in case deployment strips outputs or
notebook not available except through ContentsManager)
from_ : address to send the email from
type : type to convert notebook to
template : template to use when converting notebook
code : include input cells in notebook
subject : subject of email
also_attach : also attach pdf/html/both
'''
将dataframe作为csv或电子表格附加
在 jupyterlab_email.attachments
def attach(data, filename, type):
修改 jupyterlab_email.attachments.EXCEL_ENGINE
以使用不同的excel writer(默认为 xlsxwriter
)
内联LaTeX
在 jupyterlab_email.attachments
def latex(expression):
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(10, 1))
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.axis('off')
plt.text(0, 0.6, r'$%s$' % expression, fontsize=25)
plt.show()
关闭
jupyterlab_email-0.3.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 910faac580cbb5d5c912bfe87f4cfb663813efd3d68e57b676393e1f6cf16d32 |
|
MD5 | f2f8ac59c101b5f31d32b4ca3d59ec60 |
|
BLAKE2b-256 | e8538eb1c1ca05533dee54771083ef1f0379b3a1e7c0a9a0fca03ac856cf2322 |
关闭
jupyterlab_email-0.3.1-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | d110d1c975bb91a7622213f3b649891a0bfe5a0262d4c4e5893634e78161a148 |
|
MD5 | 81780e80d67e69bf9b73823a79ba0f99 |
|
BLAKE2b-256 | 51bcc3a13d870f695257176902fd841074a238f0071db3c7984d5ea99930a7a9 |