Xonsh kernel for Jupyter Notebook and Jupyter Lab allows to execute xonsh shell commands in a notebook cell
Project description
Xonsh kernel for Jupyter Notebook and Jupyter Lab allows to execute xonsh shell commands in a notebook cell.
If you like the idea click ⭐ on the repo and tweet.
Installation
To install use xpip:
xpip install xontrib-jupyter
# or: xpip install -U git+https://github.com/xonsh/xontrib-jupyter
xontrib load jupyter
xonfig jupyter-kernel --help # Options for installing.
xonfig jupyter-kernel --user # Install kernel spec in user config directory.
Check the installation:
jupyter kernelspec list
# Available kernels:
# python3 /opt/homebrew/lib/python3.11/site-packages/ipykernel/resources
# xonsh /PATH_TO_ENV_PREFIX/share/jupyter/kernels/xonsh
xontrib load jupyter
xonfig jupyter-kernel
# Installing Jupyter kernel spec:
# root: None
# prefix: /PATH_TO_ENV_PREFIX/
# as user: False
xonfig info
#| jupyter | True
#| jupyter kernel | /PATH_TO_ENV_PREFIX/share/jupyter/kernels/xonsh
Usage
Jupyter
Just run Jupyter Notebook or JupyterLab and choose xonsh:
jupyter notebook
# or
jupyter lab
Euporie
Euporie is a terminal based interactive computing environment.
euporie-notebook --kernel-name xonsh # or change the kernel in UI
# or
euporie-console --kernel-name xonsh # or change the kernel in UI
Testing
- install the project with its dependencies
poetry install
poetry install --only-root
- now start the xonsh shell
xonsh --no-rc
- inside the xonsh shell, you can load the jupyter xontrib and install the kernel
xontrib load jupyter
# this will install the kernel
xonfig jupyter-kernel --user
# now start a notebook and choose xonsh kernel
jupyter notebook
Releasing your package
- Create a GitHub release with the desired version number as the tag (e.g. v0.3.3).
- It will automatically build the package and upload it to the PyPI.
Known issues
Uncaptured output
In some cases you need to enable capturing first:
$XONSH_CAPTURE_ALWAYS = True
$XONSH_SUBPROC_CAPTURED_PRINT_STDERR = True
Uncaptured output because of pager
Some tools like AWS CLI using the uncapturable less pager to show the output by default. In these cases you need to find the way to disable the pager e.g. set $AWS_PAGER = 'cat' for AWS CLI.
Credits
- This package was created with xontrib cookiecutter template.
- awesome-jupyter - A curated list of awesome Jupyter projects, libraries and resources.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xontrib_jupyter-0.3.4.tar.gz.
File metadata
- Download URL: xontrib_jupyter-0.3.4.tar.gz
- Upload date:
- Size: 51.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a42a11c3d6a7d7f7de7ae18ef1cb40ed584a8cdca5627d1b94de88c5daecb9b7
|
|
| MD5 |
1e368bd59bff32e7da0f5c490add3923
|
|
| BLAKE2b-256 |
0af8f14d328c296696e471df4041e99d8734f8a1d0369f55f20fa1b9ff1498a8
|
Provenance
The following attestation bundles were made for xontrib_jupyter-0.3.4.tar.gz:
Publisher:
release.yml on xonsh/xontrib-jupyter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xontrib_jupyter-0.3.4.tar.gz -
Subject digest:
a42a11c3d6a7d7f7de7ae18ef1cb40ed584a8cdca5627d1b94de88c5daecb9b7 - Sigstore transparency entry: 713805416
- Sigstore integration time:
-
Permalink:
xonsh/xontrib-jupyter@3646c1896cfa87fa27bb1cb8d52d0a85070a615c -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/xonsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3646c1896cfa87fa27bb1cb8d52d0a85070a615c -
Trigger Event:
push
-
Statement type:
File details
Details for the file xontrib_jupyter-0.3.4-py3-none-any.whl.
File metadata
- Download URL: xontrib_jupyter-0.3.4-py3-none-any.whl
- Upload date:
- Size: 50.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b7bc22bae09ced213d9f86236b3a1be2c7c342f8c68e5b45d920fd6d8193d96
|
|
| MD5 |
6381bb2acd25ea22d50f9e0f18b45e8e
|
|
| BLAKE2b-256 |
416b6a6961129b75063dba6f108271bfe6a72c9f953158c86d978b6ffa73d262
|
Provenance
The following attestation bundles were made for xontrib_jupyter-0.3.4-py3-none-any.whl:
Publisher:
release.yml on xonsh/xontrib-jupyter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xontrib_jupyter-0.3.4-py3-none-any.whl -
Subject digest:
5b7bc22bae09ced213d9f86236b3a1be2c7c342f8c68e5b45d920fd6d8193d96 - Sigstore transparency entry: 713805419
- Sigstore integration time:
-
Permalink:
xonsh/xontrib-jupyter@3646c1896cfa87fa27bb1cb8d52d0a85070a615c -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/xonsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3646c1896cfa87fa27bb1cb8d52d0a85070a615c -
Trigger Event:
push
-
Statement type: