Convert jupyter notebook to .py file
Project description
jup2py - Make jupyter notebook production ready
Simplest way to convert jupyter notebook to production ready .py file
Introduction
As a data scientist or some one who loves quick proto-typing, you might be using Jupyter notebook or Ipython console to build your data pipelines or modelling iteration. Finally when it's time for deployment, the hard time starts, converting jupyter notebook to simple py file.
You have conventional ways to download it as a .py file from console with or by downloading as .py file from Jupyter Notebooks. But they never make it production ready .py file, somethings they mess with magic words or plots.
Installation
To install Jup2Py from PyPI:
$ pip install jup2py
- Jup2Py supports Python 3.6 and above
- Only requirement as of now is
nbconvert
Jup2Py is still considered in "alpha" stage, and the released version may change often; therefore, the best way to keep up-to-date with the latest development is to clone this repository.
Usage
Jup2Py is made to remove complexity and make it super easy.
Options:
Jup2Py :- Simple way to convert your Jupyter Notebook to .py
Please make sure that you have saved the Notebook before running Jup2Py
usage: jup2py [-h] [-v] [-i INPUT] [-o OUTPUT]
Jup2Py :- Simple way to convert your Jupyter Notebook to .py
optional arguments:
-h, --help show this help message and exit
-v, --version Jup2Py Version
-i INPUT, --input INPUT
Input Jupyter Notebook to be converted to .py file
-o OUTPUT, --output OUTPUT
[Optional]: Output python file name and location
Example
-
NOTE - Jup2Py requires you to save the Jupyter Notebook before using jup2py
-
Command Line
jup2py -i <<JUPYTER_NOTEBOOK.ipynb>> -o <<PYTHON_FILENAME.py>>
-o/ --output is totally optional, if you don't supply it will save the .py in the same directory save the .ipynb file
jup2py -i tests\jup2py_sample.ipynb
- Python Code
import jup2py
jup2py.jup2py("tests/jup2py_test.ipynb", "tests/test.py")
Second argument is totally optional, if you don't supply it will save the .py in the same directory save the .ipynb file
NOTE: - The output file is non-interactive in nature and will override if any previous same name file is found at that location.
Conversion
Sample Jupyter Notebook -
Jup2Py converted to production ready .py file in no time -
Contact Us
Jup2Py is a very small initiative I took, there are lot of things we can improve on this and make this more stronger.
Please don't hesitate to report a bug through issues.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jup2py-0.1.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 959862e6dd7250fd9c7b0dbbadf63b137333878367c0e8e2b1cdd05cebf9626d |
|
MD5 | 64c58800e8445bc21d5a49fdee86dd17 |
|
BLAKE2b-256 | 34522a4144ffb6012ac84d82c89a4b57ffa9fcdd86fb4428b40bc7eb06ac0c9f |