Honestly, I’d recommend `nbformat` if you want full control over the conversion process.
You can write a small script to parse the .py file and create cells dynamically. Here’s a snippet to get you started:
```python
import nbformat as nbf
nb = nbf.v4.new_notebook()
nb.cells.append(nbf.v4.new_code_cell("your code here"))
nbf.write(nb, "output.ipynb")
```
Bit more work, but super flexible.
You can write a small script to parse the .py file and create cells dynamically. Here’s a snippet to get you started:
```python
import nbformat as nbf
nb = nbf.v4.new_notebook()
nb.cells.append(nbf.v4.new_code_cell("your code here"))
nbf.write(nb, "output.ipynb")
```
Bit more work, but super flexible.
