All Projects → nfultz → Nb2mail

nfultz / Nb2mail

Send a notebook as an email

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Nb2mail

Aws Machine Learning University Accelerated Nlp
Machine Learning University: Accelerated Natural Language Processing Class
Stars: ✭ 1,695 (+1266.94%)
Mutual labels:  jupyter-notebook
Off Nutrition Table Extractor
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Predictive Maintenance
Data Wrangling, EDA, Feature Engineering, Model Selection, Regression, Binary and Multi-class Classification (Python, scikit-learn)
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Curso Series Temporales
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Oc Nn
Repository for the One class neural networks paper
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Pygru4rec
PyTorch Implementation of Session-based Recommendations with Recurrent Neural Networks(ICLR 2016, Hidasi et al.)
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
India Election Data
To map publicly available datasets related to General Assembly (Lok Sabha) elections in India.
Stars: ✭ 122 (-1.61%)
Mutual labels:  jupyter-notebook
Error Detection
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Flask Rest Setup
Notes on Flask REST API and tutorial
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Software Training
RoboJackets Software Training
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Mnist Coreml Training
Training MNIST with CoreML on Device
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Data Science
Toda semana um novo material estará disponível para guiar no estudo de ciência de dados =)
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Rl Quadcopter
Teach a Quadcopter How to Fly!
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Parallel ml tutorial
Tutorial on scikit-learn and IPython for parallel machine learning
Stars: ✭ 1,566 (+1162.9%)
Mutual labels:  jupyter-notebook
Carnd Lenet Lab
Implement the LeNet deep neural network model with TensorFlow.
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Kaggle Web Traffic
1st place solution
Stars: ✭ 1,641 (+1223.39%)
Mutual labels:  jupyter-notebook
Code2pix
code2pix: Generating Graphical User Interfaces from Code (A Differentiable Compiler)
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Gdeltpyr
Python based framework to retreive Global Database of Events, Language, and Tone (GDELT) version 1.0 and version 2.0 data.
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook
Jupyterlab Demo
Demonstrations of JupyterLab
Stars: ✭ 122 (-1.61%)
Mutual labels:  jupyter-notebook
Simplegesturerecognition
A very simple gesture recognition technique using opencv and python
Stars: ✭ 124 (+0%)
Mutual labels:  jupyter-notebook

nb2mail - send a jupyter notebook as an email

PyPI version

This repo contains a jupyter nbconvert exporter to convert notebooks to multipart MIME, and a postprocessor to send it via smtp.

Installation

pip install nb2mail

Usage

nb2mail does not do anything by itself. It provides an export format ("mail") and postprocessor ("SendMailPostProcessor"). Please see the nbconvert documentation and example configuration for more information.

Example

To generate a mail and send it later with another process (eg sendmail):

jupyter nbconvert --execute --to mail notebook.ipynb

To convert and send a mail via gmail, you can set the environment variables and declare a postprocessor with --post:

export [email protected] GMAIL_USER=user GMAIL_PASS="*****"
jupyter nbconvert --to mail --post=nb2mail.SendMailPostProcessor notebook.ipynb

Alternatively, you can configure the SMTP settings in a config file config.py:

c = get_config()
c.NbConvertApp.export_format = 'mail'
c.Exporter.preprocessors = 'nbconvert.preprocessors.ExecutePreprocessor'
c.NbConvertApp.postprocessor_class = 'nb2mail.SendMailPostProcessor'
c.SendMailPostProcessor.recipient = '[email protected]'
c.SendMailPostProcessor.smtp_user = 'user'
c.SendMailPostProcessor.smtp_pass = '*******'
c.SendMailPostProcessor.smtp_addr = 'smtp.gmail.com'
c.SendMailPostProcessor.smtp_port = 587

and then run:

jupyter nbconvert --config config.py demo.ipynb

Configuring Mail Headers

In the notebook metadata, you can set mail headers by adding a nb2mail block:

"nb2mail": {
"attachments": [
    "business_report_attachment.xlsx"
],
"From": "[email protected]",
"To": "[email protected], [email protected]",
"Subject": "Business Report"
}

You can specify multiple recipients by seperating them with commas.

Disabling Pilcrows

Since CSS doesn't render the same in email, you may want to disable the pilcrows after each section.

c.MailExporter.anchor_link_text = '' # disable pilcrow, requires nbconvert >= 5.2

Refences

TODO

  • Prerender Math - no js in email

  • Prettier templates

  • Plotly - here is a workaround:

    # py.iplot(fig, filename=‘dcm_ctr_subplots’)
    # The above line is what you normally use to show your plots in the notebook
    # You no longer need that and just need the stuff below
    
    from IPython.display import Image
    
    py.image.save_as(fig, filename='yahoo_dcm_ctr_subplots.png')
    Image('yahoo_dcm_ctr_subplots.png')
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].