<p align="center">
Xonsh kernel for Jupyter Notebook and Jupyter Lab allows to execute
xonsh shell commands in a notebook cell.
</p>
<p>
<img src="https://repository-images.githubusercontent.com/471969357/c372c71d-2baa-4804-9e01-d7305316b500">
</p>
<p align="center">
If you like the idea click ⭐ on the repo and <a href="https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/xonsh/xontrib-jupyter" target="_blank">tweet</a>.
</p>
## Installation
To install use [xpip](https://xon.sh/aliases.html#xpip):
```xsh
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:
```xsh
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](https://jupyter.org/) and choose xonsh:
```xsh
jupyter notebook
# or
jupyter lab
```
### Euporie
[Euporie](https://github.com/joouha/euporie) is a terminal based interactive computing environment.
```xsh
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
```bash
poetry install
poetry install --only-root
```
- now start the xonsh shell
```sh
xonsh --no-rc
```
- inside the xonsh shell, you can load the jupyter xontrib and install the kernel
```sh
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
1. Bump the version of the package `poetry version patch` (or minor/major)
2. Push the changes to the repo and publish with
```bash
poe release
```
3. The release notes are automatically generated as a draft release after each PR.
4. Create a GitHub release from the draft release against the newly pushed tag
## Known issues
### Uncaptured output
In some cases you need to enable capturing first:
```xsh
$XONSH_CAPTURE_ALWAYS = True
$XONSH_SUBPROC_CAPTURED_PRINT_STDERR = True
```
### Uncaptured output because of pager
Some tools like [AWS CLI](https://aws.amazon.com/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'`](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-pagination.html#cli-usage-pagination-awspager) for AWS CLI.
## Credits
* This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).
* [awesome-jupyter](https://github.com/markusschanta/awesome-jupyter) - A curated list of awesome Jupyter projects, libraries and resources.
Raw data
{
"_id": null,
"home_page": "https://github.com/xonsh/xontrib-jupyter",
"name": "xontrib-jupyter",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "xontrib, xonsh",
"author": "Xonsh Dev",
"author_email": "jnoortheen@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/55/7e/b0a0d1fc43068f85ba59b4b11d59dba916995144136e0e52820f2c97dc86/xontrib_jupyter-0.3.2.tar.gz",
"platform": null,
"description": "<p align=\"center\">\nXonsh kernel for Jupyter Notebook and Jupyter Lab allows to execute\nxonsh shell commands in a notebook cell.\n</p>\n\n<p>\n<img src=\"https://repository-images.githubusercontent.com/471969357/c372c71d-2baa-4804-9e01-d7305316b500\">\n</p>\n\n<p align=\"center\">\nIf you like the idea click \u2b50 on the repo and <a href=\"https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/xonsh/xontrib-jupyter\" target=\"_blank\">tweet</a>.\n</p>\n\n\n## Installation\n\nTo install use [xpip](https://xon.sh/aliases.html#xpip):\n\n```xsh\nxpip install xontrib-jupyter\n# or: xpip install -U git+https://github.com/xonsh/xontrib-jupyter\n\nxontrib load jupyter\nxonfig jupyter-kernel --help # Options for installing.\nxonfig jupyter-kernel --user # Install kernel spec in user config directory.\n```\n\nCheck the installation:\n```xsh\njupyter kernelspec list\n# Available kernels:\n# python3 /opt/homebrew/lib/python3.11/site-packages/ipykernel/resources\n# xonsh /PATH_TO_ENV_PREFIX/share/jupyter/kernels/xonsh\n\nxontrib load jupyter\nxonfig jupyter-kernel\n# Installing Jupyter kernel spec:\n# root: None\n# prefix: /PATH_TO_ENV_PREFIX/\n# as user: False\n\nxonfig info\n#| jupyter | True\n#| jupyter kernel | /PATH_TO_ENV_PREFIX/share/jupyter/kernels/xonsh\n\n```\n\n## Usage\n\n### Jupyter\n\nJust run [Jupyter Notebook or JupyterLab](https://jupyter.org/) and choose xonsh:\n\n```xsh\njupyter notebook\n# or\njupyter lab\n```\n\n### Euporie\n\n[Euporie](https://github.com/joouha/euporie) is a terminal based interactive computing environment.\n\n```xsh\neuporie-notebook --kernel-name xonsh # or change the kernel in UI\n# or\neuporie-console --kernel-name xonsh # or change the kernel in UI\n```\n\n## Testing\n\n- install the project with its dependencies\n```bash\npoetry install\npoetry install --only-root\n```\n- now start the xonsh shell\n\n```sh\nxonsh --no-rc\n```\n\n- inside the xonsh shell, you can load the jupyter xontrib and install the kernel\n\n```sh\nxontrib load jupyter\n\n# this will install the kernel\nxonfig jupyter-kernel --user\n\n# now start a notebook and choose xonsh kernel\njupyter notebook\n```\n\n## Releasing your package\n\n1. Bump the version of the package `poetry version patch` (or minor/major)\n2. Push the changes to the repo and publish with\n\n ```bash\n poe release\n ```\n\n3. The release notes are automatically generated as a draft release after each PR.\n4. Create a GitHub release from the draft release against the newly pushed tag\n\n## Known issues\n\n### Uncaptured output\n\nIn some cases you need to enable capturing first:\n\n```xsh\n$XONSH_CAPTURE_ALWAYS = True\n$XONSH_SUBPROC_CAPTURED_PRINT_STDERR = True\n```\n\n### Uncaptured output because of pager\n\nSome tools like [AWS CLI](https://aws.amazon.com/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'`](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-pagination.html#cli-usage-pagination-awspager) for AWS CLI.\n\n## Credits\n\n* This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).\n* [awesome-jupyter](https://github.com/markusschanta/awesome-jupyter) - A curated list of awesome Jupyter projects, libraries and resources.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Xonsh kernel for Jupyter Notebook and Jupyter Lab allows to execute xonsh shell commands in a notebook cell",
"version": "0.3.2",
"project_urls": {
"Code": "https://github.com/xonsh/xontrib-jupyter",
"Documentation": "https://github.com/xonsh/xontrib-jupyter/blob/master/README.md",
"Homepage": "https://github.com/xonsh/xontrib-jupyter",
"Issue tracker": "https://github.com/xonsh/xontrib-jupyter/issues",
"Repository": "https://github.com/xonsh/xontrib-jupyter"
},
"split_keywords": [
"xontrib",
" xonsh"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "531652bf32e5eee480361d3e63bb7baff8e444bfed71eed965eb60997f66dfc8",
"md5": "bda703782efd66d96e492e60fc7c6776",
"sha256": "7e8518a0aad90eb939046d747d8aa7ffe4605b5d43c259776cee60ff575f52ab"
},
"downloads": -1,
"filename": "xontrib_jupyter-0.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bda703782efd66d96e492e60fc7c6776",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 50888,
"upload_time": "2024-07-08T18:30:59",
"upload_time_iso_8601": "2024-07-08T18:30:59.620776Z",
"url": "https://files.pythonhosted.org/packages/53/16/52bf32e5eee480361d3e63bb7baff8e444bfed71eed965eb60997f66dfc8/xontrib_jupyter-0.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "557eb0a0d1fc43068f85ba59b4b11d59dba916995144136e0e52820f2c97dc86",
"md5": "59c2cfe365835da0f1db2283afcdd494",
"sha256": "392de424e5691b2be74d92b49232e1b510441c615a00ae114b3fa77c84fd942e"
},
"downloads": -1,
"filename": "xontrib_jupyter-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "59c2cfe365835da0f1db2283afcdd494",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 52289,
"upload_time": "2024-07-08T18:31:01",
"upload_time_iso_8601": "2024-07-08T18:31:01.082603Z",
"url": "https://files.pythonhosted.org/packages/55/7e/b0a0d1fc43068f85ba59b4b11d59dba916995144136e0e52820f2c97dc86/xontrib_jupyter-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-08 18:31:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xonsh",
"github_project": "xontrib-jupyter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "xontrib-jupyter"
}