Skip to main content

Sending emails from JupyterLab

Project description

jupyterlab_email

A jupyterlab extension to email notebooks from the browser.

Build Status GitHub issues Coverage PyPI PyPI npm

Options

  • Inline notebook as email, with code
  • Inline notebook as email, without code
  • Send notebook as HTML attachment, with code
  • Send notebook as HTML attachment, without code
  • Send notebook as PDF attachment, with code
  • Send notebook as PDF attachment, without code
  • Attach output data as CSV, TSV, PDF, PNG, or Excel Spreadsheet

Install

pip install jupyterlab_email
jupyter labextension install jupyterlab_email
jupyter serverextension enable --py jupyterlab_email

Adding templates

install the server extension, and add the following to jupyter_notebook_config.py

c.JupyterLabEmail.smtp_servers = [{'name': 'gmail',
                                   'domain': 'gmail.com',
                                   'username': '<YOUR USERNAME>',
                                   'smtp': 'smtp.gmail.com',
                                   'port': 465}]

Create email from notebook:

Use the function in 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
    '''

Attach dataframe as csv or spreadsheet

In jupyterlab_email.attachments

def attach(data, filename, type):

Modify jupyterlab_email.attachments.EXCEL_ENGINE to use a different excel writer (defaults to xlsxwriter)

Inline LaTeX

In 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()

Project details


Download files

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

Source Distribution

jupyterlab_email-0.2.3.tar.gz (137.4 kB view details)

Uploaded Source

Built Distribution

jupyterlab_email-0.2.3-py2.py3-none-any.whl (31.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file jupyterlab_email-0.2.3.tar.gz.

File metadata

  • Download URL: jupyterlab_email-0.2.3.tar.gz
  • Upload date:
  • Size: 137.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for jupyterlab_email-0.2.3.tar.gz
Algorithm Hash digest
SHA256 69b8c01ae375a514d4098d8cf4f54eb3b9ae8c4e2ea4187710b4400b74fd602b
MD5 28b92420bd5ba44bb986cdb7a9668a8d
BLAKE2b-256 4f4a8d075db062ce3c086d4d428b289f7fc73adb53d22e51f3b0c3c239ed6756

See more details on using hashes here.

File details

Details for the file jupyterlab_email-0.2.3-py2.py3-none-any.whl.

File metadata

  • Download URL: jupyterlab_email-0.2.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for jupyterlab_email-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9a67779abbdd390aeb167199e23155e93e7527ade2454ce0e5b1a7c3e1dd26fa
MD5 66509cb5ced0c8fd3d35bc9268c9a4e1
BLAKE2b-256 65ce1fb93e9a559ef26ab90d0b359fff30c62dc08b30f6abda77b5f8b6de7ee7

See more details on using hashes here.

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