How to save a Jupyter notebook as a python file

In this article, we will discuss how you can save your jupyter notebook (.ipynb) as a python file (.py) for easy upload to the platform when creating an analysis.

When creating an analysis for approval in the Roseman Labs Platform, you will need to upload two files: the .recording file and the analysis script (refer to this article for more information on script recording). For the upload of the analysis script, our platform currently only supports standard executable python files (.py). Since we are aware that many data scientists like working with Jupyter notebooks (.ipynb files), we will explain how you can export your notebook into the correct file format to streamline the analysis creation process. 

This help center article assumes that you have already written your analysis design script (i.e. where you execute the script on dummy data). 

 

1. Once you have your design script ready, go to the "File" menu item located in the top left corner.

 

2. Then select the menu item "Save and export notebook as..."

 

3. From here, you have the option to choose from a list of available export formats, and from these options you select "Executable script". This will allow you to download the notebook as a .py file for easy upload to the platform, such that the approver can read the python code you wish to execute on sensitive data. 

 

4. This will open the system dialog window allowing you to enter a name for the python file and select a location on your local file system to save it. Finally click "Save" to confirm. 

 

Now when you create an analysis in the platform, upload this .py file alongside the .recording file. 


Thank you for taking the time to read this article. If you have feedback or if you seek more information on specific topics, leave your comments below or reach out to support@rosemanlabs.com