nbstata
nbstata copied to clipboard
Shell Command Magic for Stata Kernel
It would be helpful to support a shell-style magic command that sends input directly to the system terminal; similar to how the Python kernel uses the !command syntax. My first idea was to use Stata's native shell command, but it doesn't recognize my Jupyter installation. I don't know if others have the same problem..
Use Case:
One particularly useful application would be the ability to export a notebook’s Stata code cells to a .do file using nbconvert or a custom script, all from within the notebook itself. An even better addition would be another magic to quickly generate a do file.
Yes, love this idea. We should be able to do it in the same way as IPythonKernel does, though that's easier said than done (for me).
I am curious, why is that? I might be wrong, but I assume that getting the !command is the easy part.
The PyStataKernel inherits from IPythonKernel, that means it has all the logic of execute_request() from ipykernel/ipykernel/kernelbase.py and do_execute() from ipykernel/ipykernel/ipkernel.py.
Can't it just do that?