A Jupyter kernel for Stata built on pystata
GPL-3.0 License
nbstata
is a Jupyter
kernel for
Stata built on top of
pystata.
For the User Guide, click here.
JupyterLab is a browser-based editor that allows you to combine interactive code and results with Markdown in a single document (called a Jupyter notebook). It is open source and widely used. Though it is named after the three core programming languages it supports (Julia, Python, and R), it can be used with with a wide variety of languages.
nbstata
allows you to create Stata notebooks (as opposed to using
Stata within a Python
notebook,
which is needlessly clunky if you are working primarily with Stata).
nbstata
featuresbrowse
-like capabilities (e.g., interactivedescribe
and e
/return list
)#delimit ;
interactive support (along with all types of…that you can’t do with the official Stata interface?
[1] Stata dynamic
documents
can do this part, though with a less interactive workflow. (See also:
markstat,
stmd,
and
Statamarkdown)
Using nbstata
with
Quarto
instead gives you a similar workflow, with greater flexibility of
output.
nbstata
is being developed using
nbdev.
The /nbs
directory is where edits to the source code should be made.
(The python code is then exported to the /nbdev
library folder.)
For more, see CONTRIBUTING.md.
Kyle Barron authored the original stata_kernel
, which works for older
versions of Stata. Vinci Chow created a Stata kernel that instead uses
pystata, which first became
available with Stata 17. nbstata
was originally derived from his
pystata-kernel, but much
of the docs and newer features are derived from stata_kernel
.