Is there a way to create a .ipynb from a .py file command line?
Why I would want to do this: I want to refactore some code using a text editor. My ipynb file is on a server, and it is way easier to transfer a .py file (generated by running ipython notebook with --script) that is tracked on a version control system (git) than ipynb.
Ideally I want to do the following:
--script
, so I have a .py fileAnd I can't find any way to start on the server an iPython Notebook from a py file that is on the server.
Sure, I can add the .ipynb to git, but there are good reasons not to do that. I could also send files using ftps, but since it is something I do rather often I'd like to find a better solution.
From https://pypi.org/project/ipynb-py-convert/
pip install ipynb-py-convert
Example
ipynb-py-convert examples/plot.py examples/plot.ipynb
or
ipynb-py-convert examples/plot.ipynb examples/plot.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With