# Saving notebook as an HTML file to EOS

**URL:** <https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198>\
**Category:** Jupyter Notebooks\
**Created:** [February 14, 2020, 4:40pm UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198 "2020-02-14T16:40:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmacieje](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/m/b9e5f3/32.png) [@mmacieje](https://swan-community.web.cern.ch/u/mmacieje)\
**Post date:** [February 14, 2020, 4:40pm UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/1 "2020-02-14T16:40:24Z")

</div>

Hello,

I am running an analysis notebook with spark (NXCALS). I’d like to save completed notebook as an html file to EOS. What would be the advised way of doing so. In case I don’t use spark, I can execute the following command:

```
notebook_name = 'SaveNotebookAsHTMLToEOS.ipynb'
file_name = 'SaveNotebookAsHTMLToEOS.html'
import sys
!{sys.executable} -m jupyter nbconvert --to html $notebook_name --output /eos/project/l/lhcsm/$file_name

```

However, in case I am connected with spark, I got an error as shown here: [https://gitlab.cern.ch/LHCData/lhc-sm-apps/blob/master/hwc/SaveNotebookAsHTMLToEOS.ipynb](https://gitlab.cern.ch/LHCData/lhc-sm-apps/blob/master/hwc/SaveNotebookAsHTMLToEOS.ipynb)

Thank you for any piece of advice you can offer.

Cheers, Michał.

---

<div class="post-metadata">

**Author:** ![ozapatam](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/o/a183cd/32.png) [@ozapatam](https://swan-community.web.cern.ch/u/ozapatam)\
**Post date:** [February 17, 2020, 9:07am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/2 "2020-02-17T09:07:49Z")

</div>

Hello @mmacieje

maybe @pmrowczy or @pkothuri can help us?

cheers

---

<div class="post-metadata">

**Author:** ![etejedor](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://swan-community.web.cern.ch/u/etejedor)\
**Post date:** [February 17, 2020, 9:20am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/3 "2020-02-17T09:20:45Z")

</div>

Hi Michal,

Perhaps @pmrowczy can comment on the Spark error, but from the notebook interface you can also select to download a given notebook as HTML (File-\>Download as-\>HTML).

---

<div class="post-metadata">

**Author:** ![pmrowczy](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/p/c5a1d2/32.png) [@pmrowczy](https://swan-community.web.cern.ch/u/pmrowczy)\
**Post date:** [February 17, 2020, 9:32am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/4 "2020-02-17T09:32:00Z")

</div>

@etejedor @ozapatam I think the goal here is to save directly to EOS, not to your ~/Downloads folder as with Download As button. So @mmacieje needs programmatically to do that, we will have a look.

---

<div class="post-metadata">

**Author:** ![mmacieje](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/m/b9e5f3/32.png) [@mmacieje](https://swan-community.web.cern.ch/u/mmacieje)\
**Post date:** [February 17, 2020, 10:32am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/5 "2020-02-17T10:32:57Z")

</div>

@etejedor, @ozapatam, @pmrowczy  
Indeed, the goal is to programatically write a final html file to the EOS project space.

Many thanks in advance for looking into that.

Cheers, Michał.

---

<div class="post-metadata">

**Author:** ![ozapatam](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/o/a183cd/32.png) [@ozapatam](https://swan-community.web.cern.ch/u/ozapatam)\
**Post date:** [February 17, 2020, 10:33am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/6 "2020-02-17T10:33:56Z")

</div>

Hello Michal,  
we found the issue and the problem is that nbconvert is taking tornado from the docker image and not from cvmfs

![image](https://swan-community.web.cern.ch/uploads/default/original/1X/72bf9ca68c9c25109b493c5ffd759f8dcc81b92f.png)

This week we will deploy the new version of SWAN in production and the issue will be fixed.

But nbconvert is working for the terminal of swan, the issue is only with the notebook.  
if you want to can to use the terminal for this at the moment.

Cheers

---

<div class="post-metadata">

**Author:** ![mmacieje](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/m/b9e5f3/32.png) [@mmacieje](https://swan-community.web.cern.ch/u/mmacieje)\
**Post date:** [February 17, 2020, 10:46am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/7 "2020-02-17T10:46:04Z")

</div>

Hello Omar,

great, thank you! This is a very useful feature for us.

Cheers, Michał.

---

<div class="post-metadata">

**Author:** ![mmacieje](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/m/b9e5f3/32.png) [@mmacieje](https://swan-community.web.cern.ch/u/mmacieje)\
**Post date:** [February 25, 2020, 10:45am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/8 "2020-02-25T10:45:51Z")

</div>

Hello,

I tried again to save a notebook as an HTML file. The issue seems still to be there.  
Could you please kindly cross-check that?

Thank you in advance, Michał.

---

<div class="post-metadata">

**Author:** ![dalvesde](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dalvesde](https://swan-community.web.cern.ch/u/dalvesde)\
**Post date:** [February 25, 2020, 11:04am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/9 "2020-02-25T11:04:45Z")

</div>

Hi Michal,  
The update hasn’t been pushed yet. We will notify you when we do.  
Cheers,  
Diogo

---

<div class="post-metadata">

**Author:** ![mmacieje](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/m/b9e5f3/32.png) [@mmacieje](https://swan-community.web.cern.ch/u/mmacieje)\
**Post date:** [March 17, 2020, 10:41am UTC](https://swan-community.web.cern.ch/t/saving-notebook-as-an-html-file-to-eos/198/10 "2020-03-17T10:41:52Z")

</div>

Hi Diogo,

is there any update?  
We moved to executing more and more notebooks for which automatic generation of reports would be a huge time saver.

Thank you in advance for your time and consideration.

Cheers, Michał.
