<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create new workbooks with code in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/create-new-workbooks-with-code/m-p/55305#M6269</link>
    <description>&lt;P&gt;Unfortunaly %run does not help me since I can't %run a .py file. I still need my code in notebooks.&lt;/P&gt;&lt;P&gt;I am transpiling propriatary code to python using jinja templates. I would like to have the output as notebooks since those are most convenient to edit in databricks.&lt;/P&gt;&lt;P&gt;Perhaps calling the workspace API is a possible way forward then? Can i call this from a databrick notebook?&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/workspace/import" target="_blank"&gt;Import a workspace object | Workspace API | REST API reference | Databricks on AWS&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Dec 2023 09:01:10 GMT</pubDate>
    <dc:creator>invalidargument</dc:creator>
    <dc:date>2023-12-15T09:01:10Z</dc:date>
    <item>
      <title>Create new workbooks with code</title>
      <link>https://community.databricks.com/t5/get-started-discussions/create-new-workbooks-with-code/m-p/55238#M6267</link>
      <description>&lt;P&gt;Is is possible to create new notebooks from a notevbook in databricks?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried this code. But all of them are generic files, not notebooks.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;notebook_str = """# Databricks notebook source

import pyspark.sql.functions as F
import numpy as np

# COMMAND ----------

# A test notebook
np.__version__
"""
with open("./notebook.ipynb","w") as f:
    f.write(notebook_str)

with open("./notebook.py","w") as f:
    f.write(notebook_str)

with open("./notebook","w") as f:
    f.write(notebook_str)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 14 Dec 2023 11:40:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/create-new-workbooks-with-code/m-p/55238#M6267</guid>
      <dc:creator>invalidargument</dc:creator>
      <dc:date>2023-12-14T11:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create new workbooks with code</title>
      <link>https://community.databricks.com/t5/get-started-discussions/create-new-workbooks-with-code/m-p/55305#M6269</link>
      <description>&lt;P&gt;Unfortunaly %run does not help me since I can't %run a .py file. I still need my code in notebooks.&lt;/P&gt;&lt;P&gt;I am transpiling propriatary code to python using jinja templates. I would like to have the output as notebooks since those are most convenient to edit in databricks.&lt;/P&gt;&lt;P&gt;Perhaps calling the workspace API is a possible way forward then? Can i call this from a databrick notebook?&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/workspace/import" target="_blank"&gt;Import a workspace object | Workspace API | REST API reference | Databricks on AWS&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 09:01:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/create-new-workbooks-with-code/m-p/55305#M6269</guid>
      <dc:creator>invalidargument</dc:creator>
      <dc:date>2023-12-15T09:01:10Z</dc:date>
    </item>
  </channel>
</rss>

