cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Processing Notebook in python

Avinash_Narala
New Contributor III

Hi,

I exported notebook from my workspace into my local machine and want to read it in my python code .

Is there a way to read the content of my notebook programmatically and make necessary changes and save as dbc/html notebook.

 

2 REPLIES 2

ossinova
Contributor II

Not sure what you are trying to accomplish here. If you want to export a notebook as python to do manual editing locally, and then import it back into your workspace why not use repos and connect to it using VSCode etc? You can export the notebook as a python file. Just don't delete the top # Databricks notebook source line. Otherwise you can also use DBConnect and the VSCode Databricks Extension to run the code locally using your Databricks custer. 

I want to automate the refactoring, so using DBConnect and VScode extension I can develop my code.

But I want to modify already written code.

Like, Example: if in my old_notebook whereever there is table1 i need to replace with table2.

For these I need to read notebook and replace the content programmatically.