How to convert ipython 2 notebooks to ipython 3?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to convert ipython 2 notebooks to ipython 3?

Alan-49
Is there any solution or workaround?

I have more than 60 notebooks, some fairly long and I cannot simply go through all of them, so a 2to3 for *.ipynb would be right now my top sweet spot.

Many thanks in advance,

Alan

--
Alan Wilter SOUSA da SILVA, DSc
Senior Bioinformatician, UniProt
European Bioinformatics Institute (EMBL-EBI)
European Molecular Biology Laboratory
Wellcome Trust Genome Campus
Hinxton
Cambridge CB10 1SD
United Kingdom
Tel: +44 (0)1223 494588

_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to convert ipython 2 notebooks to ipython 3?

Matthias Bussonnier
Hello Alan,

If you install the recent beta of nbconvert (or wait a bit for it to
be stable), plus use https://pypi.python.org/pypi/jupytercontrib you
should be able to do :

    jupyter nbconvert --to 2to3 <mynotebook.ipynb>

This is based on
https://gist.github.com/takluyver/c8839593c615bb2f6e80 that can be ran
as a standalone script.

Hope that help and happy conversion to Python 3.
--
M

On Thu, Nov 17, 2016 at 12:56 PM, Alan <[hidden email]> wrote:

> Is there any solution or workaround?
>
> I have more than 60 notebooks, some fairly long and I cannot simply go
> through all of them, so a 2to3 for *.ipynb would be right now my top sweet
> spot.
>
> Many thanks in advance,
>
> Alan
>
> --
> Alan Wilter SOUSA da SILVA, DSc
> Senior Bioinformatician, UniProt
> European Bioinformatics Institute (EMBL-EBI)
> European Molecular Biology Laboratory
> Wellcome Trust Genome Campus
> Hinxton
> Cambridge CB10 1SD
> United Kingdom
> Tel: +44 (0)1223 494588
>
> _______________________________________________
> IPython-dev mailing list
> [hidden email]
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to convert ipython 2 notebooks to ipython 3?

Alan-49
Fantastic Matthias!

Many thanks,

Alan

On 17 November 2016 at 21:00, Matthias Bussonnier <[hidden email]> wrote:
Hello Alan,

If you install the recent beta of nbconvert (or wait a bit for it to
be stable), plus use https://pypi.python.org/pypi/jupytercontrib you
should be able to do :

    jupyter nbconvert --to 2to3 <mynotebook.ipynb>

This is based on
https://gist.github.com/takluyver/c8839593c615bb2f6e80 that can be ran
as a standalone script.

Hope that help and happy conversion to Python 3.
--
M

On Thu, Nov 17, 2016 at 12:56 PM, Alan <[hidden email]> wrote:
> Is there any solution or workaround?
>
> I have more than 60 notebooks, some fairly long and I cannot simply go
> through all of them, so a 2to3 for *.ipynb would be right now my top sweet
> spot.
>
> Many thanks in advance,
>
> Alan
>
> --
> Alan Wilter SOUSA da SILVA, DSc
> Senior Bioinformatician, UniProt
> European Bioinformatics Institute (EMBL-EBI)
> European Molecular Biology Laboratory
> Wellcome Trust Genome Campus
> Hinxton
> Cambridge CB10 1SD
> United Kingdom
> Tel: <a href="tel:%2B44%20%280%291223%20494588" value="+441223494588">+44 (0)1223 494588
>
> _______________________________________________
> IPython-dev mailing list
> [hidden email]
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-dev



--
Alan Wilter SOUSA da SILVA, DSc
Senior Bioinformatician, UniProt
European Bioinformatics Institute (EMBL-EBI)
European Molecular Biology Laboratory
Wellcome Trust Genome Campus
Hinxton
Cambridge CB10 1SD
United Kingdom
Tel: +44 (0)1223 494588

_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-dev