Search by

phpstats / juphyter

erikwestlund

A Jupyter and Quarto kernel for PHP, built for statistical work with the phpstats packages

Package info

github.com/phpstats/juphyter

pkg:composer/phpstats/juphyter

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.1 2026-10-31 17:02 UTC

This package is auto-updated.

Last update: 2026-10-31 19:52:46 UTC


README

juphyter is a Jupyter kernel for PHP. It runs PHP cells in JupyterLab notebooks and in Quarto documents, keeps one PHP session across cells, and shows phibble data frames as tables and phiz plots as charts.

Documentation: https://juphyter.phpstats.org

Requirements

  • PHP 8.3, 8.4, or 8.5, with the mbstring and tokenizer extensions.
  • Composer.
  • Python 3 with the venv module.
  • macOS or Linux.

The pcntl extension is optional and makes the stop button interrupt a running cell. Quarto is optional and renders .qmd documents.

Install

composer global require phpstats/juphyter
export PATH="$(composer global config bin-dir --absolute):$PATH"
juphyter install --create-venv ~/.venvs/juphyter
export PATH="$HOME/.venvs/juphyter/bin:$PATH"
juphyter doctor

juphyter install registers the kernel as php. It uses an existing Python environment that has ipykernel 7, or builds one with JupyterLab at ~/.venvs/juphyter. The export lines last for the current shell. juphyter doctor checks the installation and exits 1 when something is broken. The installation guide covers keeping the PATH entries, the phpstats packages, and per-project installs.

Use

In JupyterLab, run jupyter lab and choose the PHP kernel. In Quarto, name the kernel in the front matter:

---
title: "PHP in Quarto"
jupyter: php
---

```{php}
echo "sum: ", array_sum(range(1, 10)), "\n";
PHP_VERSION;
```

Then run quarto render hello.qmd.

Development

Contributing covers the tests, the documentation build, and the PHAR.

License

MIT