Replies: 7 comments
-
There isn't any templating support in the notebook currently. What sort of templating are you interested in? Depending on what you're trying to do, one or more of these DuckDB features may be useful: |
Beta Was this translation helpful? Give feedback.
-
Thank you. By template here I meant something like a prepopulated notebook. For example to distribute a database as well as a set of precanned queries to explore the data. I realize the UI code is not open source but i was wondering if there was an API or template system for populating notebook cells |
Beta Was this translation helpful? Give feedback.
-
I'd love to see this feature as well, for the same reason: sharing a notebook of queries for teaching or debugging.
|
Beta Was this translation helpful? Give feedback.
-
This isn't currently supported directly, but there is an unofficial way to programmatically export and import notebooks: https://gist.github.com/mrjsj/c40fa5ba696da7c96de8fb561e803049 The notebook files are fairly straightforward JSON; you should be able to alter their contents before importing. |
Beta Was this translation helpful? Give feedback.
-
Thats really quite nice. Is there a full list of JSON keys? Looks like: - version
- notebookSerializationFormat
- currentDatabase
- cells
- cellId
- query
- useDatabase |
Beta Was this translation helpful? Give feedback.
-
Those are most of the keys. There's also an optional |
Beta Was this translation helpful? Give feedback.
-
Sharing a quick and hacky script I created here, hope that's ok - please delete if not :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks again for this great work.
I would like to provide a Notebook with a set of queries pre-populated. Is there currently a way to template out Notebook contents?
Beta Was this translation helpful? Give feedback.
All reactions