create notebook programatically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 08:43 PM
Hello,
I have json content of the notebook with me.
Can I know is there a way to create notebook with that content using python?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 09:45 PM
Hi Kaniz,
Thank you for your reply.
Actually I don't want to create dataframe. I have json content of notebook, which I got by reading a notebook itself, but I can't create a notebook from that json.
You can see below code to understand in detail what I want to do:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 06:43 AM
hi @Avinash_Narala, just pinning this section because I'm on the search of the same procedure as you. Some important test i runned on the Topic is that, neither the magic command %sh or using the databricks CLI seens to work specifically with Notebooks, It will copy paste the result as a python file no matter what I do.
Hope there is an answer.
Tks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2024 07:39 PM
@Avinash_Narala @renancy Check out the databricks sdk documentation on `databricks.sdk.WorkspaceClient.workspace`: https://databricks-sdk-py.readthedocs.io/en/latest/workspace/workspace/workspace.html
Something like the following may be helpful:
w.workspace.import_(
path="<path to file>",
format=workspace.ImportFormat.SOURCE,
content=base64.b64encode(f.read()).decode()
)