Skip to main content

regwright-kernel

A Jupyter kernel that runs Stata syntax in notebooks (JupyterLab, Notebook, VS Code and nbconvert) using the Regwright engine. You don't need Stata.

sysuse wages, clear
regress wage educ exper
scatter wage educ

Install

  1. Install the regwright command-line tool from regwright.com, and check that regwright --version works.

  2. Install the kernel:

    pip install regwright-kernel
    

    The wheel installs the kernelspec into the environment (share/jupyter/kernels/regwright). If Jupyter runs from a different environment, register the kernel there yourself:

    python -m regwright_kernel install --user        # or --sys-prefix, or --prefix PATH
    
  3. Choose Regwright (Stata syntax) as the notebook kernel.

What it does

  • Each kernel keeps one regwright serve session, so data, macros and estimates carry over from cell to cell, as they do in a Stata session.
  • Output goes to stdout. Error messages go to stderr, and a failed cell has status error with the Stata return code as its name (for example r(111)). A notebook run with nbconvert --execute therefore stops at the first error, just as a do-file does.
  • Graphs (scatter, twoway, histogram, graph bar…) appear under the cell as SVG.
  • Tab completes command names at the start of a statement and variable names elsewhere. Shift+Tab shows a variable's type, format and label, or a one-line summary of a command.

Settings (environment variables)

Variable Meaning
REGWRIGHT_PATH Path to the regwright binary, if it isn't on PATH
REGWRIGHT_DATA Extra folders for sysuse/use, separated by : (; on Windows)
REGWRIGHT_KERNEL_ECHO=1 Echo each command (. regress …) before its output, as in a log
REGWRIGHT_LICENSE Licence key. You can also install it with regwright licence install KEY

Regwright Free handles datasets of up to 1,000 observations. Licences that remove the limit are listed at regwright.com/pricing.

Building from source

The package has its own small build backend (_backend/), so it builds with no build dependencies:

python -m pip wheel --no-deps --no-build-isolation kernel/ -w dist

To run the tests you need a regwright binary plus ipykernel, jupyter_client, nbclient and nbformat:

REGWRIGHT_BIN=/path/to/regwright REGWRIGHT_TEST_DATA=/path/with/wages.dta python kernel/tests/test_kernel.py

"Stata" is a trademark of StataCorp LLC. Regwright is an independent product and is not affiliated with StataCorp. The kernel is MIT-licensed. The Regwright engine is commercial software with a free tier.

Metadata

Release files for regwright-kernel 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for regwright-kernel 0.1.0
File Size Uploaded Provenance Actions
regwright_kernel-0.1.0.tar.gz 24.4 kB Without provenance Details for regwright_kernel-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for regwright-kernel 0.1.0
File Interpreter ABI Platform Actions
regwright_kernel-0.1.0-py3-none-any.whl Python 3 none any Details for regwright_kernel-0.1.0-py3-none-any.whl

Total release size: 50.0 kB

Release files / regwright_kernel-0.1.0.tar.gz

Download URL regwright_kernel-0.1.0.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
11744c70967d589cc7fd14e7465c65222bb45d3a34910fafcc6150722991b643
BLAKE2b-256 checksum
How to use checksums
4b879fbb6c294db741cca9784151861af57b4523a9cade9fdcc880739b1ac3f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"45","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / regwright_kernel-0.1.0-py3-none-any.whl

Download URL regwright_kernel-0.1.0-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0b97749e2e3475418b86e64281555acf23453c14e6b8d9eed20148e0e855681
BLAKE2b-256 checksum
How to use checksums
045a1e0914fd0f7a778c6264133ccae3192474e5000558f65b71717e85071628
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"45","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for regwright-kernel 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page