PyStataKernel
def PyStataKernel(
**kwargs
):A jupyter kernel based on pystata
The latest documentation for implementing a wrapper kernel is here, but the current code deviates from those instructions (which call for inheriting from kernelbase.Kernel), instead inheriting from the IPython kernel implementation, IPythonKernel.
For a diagram of the main dependencies among the principal nbstata modules, click here.
Stata is initialized during the execution of the first cell (in PyStataKernel.do_execute below) so that any configuration errors can be displayed in the notebook.
output prior to error
error message
error code
{'1': {'status': 'ok', 'data': {'text/plain': '6'}, 'metadata': {}}}
sam not found
Invalid Stata '[%fmt] [=]exp' display expression: sam
{'1': {'status': 'error',
'traceback': [],
'ename': 'Stata user expression error',
'evalue': "sam not found\n\nInvalid Stata '[%fmt] [=]exp' display expression: sam"}}
Execute Stata code cell
Display Stata ‘describe’ output (regardless of cursor position)
Provide context-aware tab-autocomplete suggestions
Overrides IPythonKernel with kernelbase default
Overrides IPythonKernel with kernelbase default