Metadata-Version: 2.4
Name: fish-kernel
Version: 1.1.0
Summary: Fish kernel for Jupyter
Project-URL: Homepage, https://github.com/eunos-1128/fish-kernel
Project-URL: Repository, https://github.com/eunos-1128/fish-kernel
Project-URL: Issues, https://github.com/eunos-1128/fish-kernel/issues
Author-email: "UENO, M." <eunosium-1128@live.jp>
License: BSD 3-Clause License
        
        Copyright (c) 2024, UENO M.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Keywords: fish,ipykernel,jupyter,kernel
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Shells
Requires-Python: >=3.10
Requires-Dist: filetype>=1.2.0
Requires-Dist: ipykernel>=6.29.4
Requires-Dist: jupyter-client>=8.6.2
Requires-Dist: pexpect>=4.9.0
Description-Content-Type: text/markdown

# Fish Kernel for Jupyter

`fish-kernel` is a Jupyter kernel implementation for the fish shell.

![](./README.png)

## Requirements

- Python `>=3.10`
- `fish` command available on `PATH`
- Jupyter frontend (`jupyterlab` or notebook)
- Supported OS: Linux, macOS, and Windows (WSL)
- Native Windows is not supported (fish shell dependency)

## Install

To register a Jupyter kernel, run a concrete install command such as:

```shell
fish-kernel add --user
```

If you want to install into the current Python environment instead, use:

```shell
fish-kernel add --sys-prefix
```

`fish-kernel install` is an alias of `fish-kernel add`, so either name works.

### PyPI

```shell
pip install fish-kernel
```

### conda-forge

Install from the conda-forge channel with conda, mamba, or pixi:

```shell
conda install -c conda-forge fish-kernel
```

```shell
mamba install -c conda-forge fish-kernel
```

```shell
pixi add fish-kernel
```

## Register kernel
After installation, register the kernelspec.

`fish-kernel add` requires one of `--user`, `--sys-prefix`, or `--prefix`.
`fish-kernel install` is an alias of `fish-kernel add`.

Install for your user account:

```shell
fish-kernel add --user
```

Or install into the current Python environment:

```shell
fish-kernel add --sys-prefix
```

After installation, verify the kernel is registered:

```shell
jupyter kernelspec list
```

You should see a `fish` kernel entry.

## Remove kernel

To unregister the kernelspec, run:

```shell
fish-kernel remove
```

`fish-kernel uninstall` is an alias of `fish-kernel remove`.

Unlike `add`, a target option is optional. With no options, `remove` deletes
whichever installed copy it finds first. If you installed the kernel into
more than one scope (for example both `--user` and `--sys-prefix`), pass the
matching option to target a specific one:

```shell
fish-kernel remove --user
fish-kernel remove --sys-prefix
fish-kernel remove --prefix /path/to/prefix
```

## Development

```shell
git clone https://github.com/eunos-1128/fish-kernel.git
cd fish-kernel
uv sync --dev
uv run pytest
uv run fish-kernel install --sys-prefix
uv run jupyter kernelspec list
```

## Documentation

Build docs locally with Sphinx + Furo:

```shell
uv sync --dev
uv run sphinx-build -b html docs docs/_build/html
```

## Usage examples

Simple calculation:

```fish
set a 7
set b 13
math $a + $b
```

## Acknowledgements

This project was developed with inspiration from:

- [bash_kernel](https://github.com/takluyver/bash_kernel)
- [zsh-jupyter-kernel](https://github.com/dahn-zk/zsh-jupyter-kernel)
