Metadata-Version: 2.4
Name: mathics3_jupyter_kernel
Version: 0.9.0
Summary: Jupyter Notebook integration for Mathics3
Maintainer-email: Mathics3 Group <mathics-devel@googlegroups.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://mathics.org/
Project-URL: Changelog, https://github.com/Mathics3/Mathics3-Frontend-jupyter/blob/master/NEWS.md
Project-URL: Downloads, https://github.com/Mathics3/Mathics3-notebook-jupyter/releases
Project-URL: Repository, https://github.com/Mathics3/Mathics3-notebook-jupyter
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Interpreters
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mathics3_notebook_frontends>=1.0.0
Requires-Dist: jupyter_client
Requires-Dist: jupyterlab
Requires-Dist: Mathics3-pygments
Provides-Extra: dev
Requires-Dist: check-jsonschema; extra == "dev"
Requires-Dist: jupyter-console; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# Mathics3 Jupyter Kernel

This provides a Jupyter Kernel for running Mathics3. In contrast to code in [Mathics3-Frontend-notebooks](https://github.com/Mathics3/Mathics3-Frontend-notebooks), this is a full Kernel rather than an extension to be loaded on top of Python 3 `ipykernel`.

## Using

After the Mathics3 Jupyter kernel is loaded, you can enter Mathics3 commands, and you will get the results evaluated and displayed.

There are two "magic" commands available, `%pip` and `%python`.

### `%pip`

The `%pip` command allows you to run Python "pip" commands or to see information on installed Python packages.


### `%python` or `%py`

The `%python` command allows you to run Python statements or evaluate Python expressions, rather than Mathics3 expressions or statements.

A special variable `session` is defined so that you have access to the underlying Python session.

## Building

Install all of the prerequisites:

```console
$ pip install -e .
```

Register the Mathics3 kernel for Jupyter via the JSON file `mathics3-jupyter/kernel.json`.

```console
$ python3 -m mathics3_jupyter_kernel.install
```

This needs to be done only once.

To see that this has been installed, run:

```console
$ jupyter kernelspec list
```


```
%load_ext mathics3_kernel.frontend.jupyter
```

Usage is as simple as executing the above code in a notebook cell,
and then Mathics3 code can be directly run in all subsequent cells.
Here is a [sample notebook](examples/jupyter-notebook.ipynb)
that can be used with a local Jupyter installation.

## Running

```console
$ jupyter lab  # or:  make lab
```

## Debugging

Install `jupyter-console` and run `jupyter console` via `make`:

```console
$ make console
jupyter console --kernel=mathics3-jupyter
Jupyter console 6.6.3

Mathics3 10.0.2dev0 Kernel (1.0)- A Mathematica-compatible engine
...
```
