Skip to main content

Jupyter kernel for Stata built on pystata

Project description

nbstata: a new Stata kernel

nbstata is a Jupyter kernel for Stata built on top of pystata.

For the User Guide, click here.

What is Jupyter?

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 features

  • Easy setup
  • Works with Stata 17+ (only).
  • Displays Stata output without the redundant ‘echo’ of (multi-line) commands
  • Autocompletion for variables, macros, matrices, and file paths
  • DataGrid widget with browse-like capabilities (e.g., interactive filtering)
  • Variable and data properties (describe and e/return list) available in a ‘contextual help’ side panel
  • Interactive/richtext help files accessible within notebook
  • #delimit ; interactive support (along with all types of comments)

What can you do with Stata notebooks…

…that you can’t do with the official Stata interface?

  • Exploratory analysis that is both:
    • interactive
    • preserved for future reference/editing
  • Present results in a way that interweaves:[1]
    • code
    • results (including graphs)
    • rich text:
      1. lists
      2. Headings
      3. links
      4. math: $y_{it}=\beta_0+\varepsilon_{it}$

[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.

Contributing

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.

Acknowledgements

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbstata-0.8.2.tar.gz (152.7 kB view details)

Uploaded Source

Built Distribution

nbstata-0.8.2-py3-none-any.whl (185.9 kB view details)

Uploaded Python 3

File details

Details for the file nbstata-0.8.2.tar.gz.

File metadata

  • Download URL: nbstata-0.8.2.tar.gz
  • Upload date:
  • Size: 152.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for nbstata-0.8.2.tar.gz
Algorithm Hash digest
SHA256 2c353be6077c819945668de9abaccc4cfa027576ecc8b1c6bd7df7f9d259dc4d
MD5 ecaf1fcf4b4d62c512d393a940e31b13
BLAKE2b-256 ea3f7fd308db45c35fe936ddaa894af921b4683cf3a12c7c9c6a37db047d0d12

See more details on using hashes here.

File details

Details for the file nbstata-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: nbstata-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 185.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for nbstata-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31ce0f38ca41a30765a3610eb91785736e2869e78ba818cc377fec82716b4f54
MD5 38b0451fabe57945c035667de53e335b
BLAKE2b-256 e37e0b9006e3fe94dfbb4f6f516a5a71b99ed5be9d4777b710d5b8b652f985f7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page