{"id":14900995,"url":"https://github.com/cptpiepmatz/nu-jupyter-kernel","last_synced_at":"2025-04-06T03:05:43.638Z","repository":{"id":235517434,"uuid":"786114584","full_name":"cptpiepmatz/nu-jupyter-kernel","owner":"cptpiepmatz","description":"📓 A wip jupyter raw kernel for nu","archived":false,"fork":false,"pushed_at":"2025-03-19T10:58:57.000Z","size":734,"stargazers_count":48,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-04T15:56:22.127Z","etag":null,"topics":["jupyter-kernel","nushell"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cptpiepmatz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-13T13:28:05.000Z","updated_at":"2025-04-03T09:05:20.000Z","dependencies_parsed_at":"2024-04-23T18:03:03.704Z","dependency_job_id":"af6ca226-c7a8-4c15-970b-34cfd4d44b3d","html_url":"https://github.com/cptpiepmatz/nu-jupyter-kernel","commit_stats":null,"previous_names":["cptpiepmatz/nu-jupyter-kernel"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptpiepmatz%2Fnu-jupyter-kernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptpiepmatz%2Fnu-jupyter-kernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptpiepmatz%2Fnu-jupyter-kernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptpiepmatz%2Fnu-jupyter-kernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cptpiepmatz","download_url":"https://codeload.github.com/cptpiepmatz/nu-jupyter-kernel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208141,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter-kernel","nushell"],"created_at":"2024-09-22T10:00:21.170Z","updated_at":"2025-04-06T03:05:43.619Z","avatar_url":"https://github.com/cptpiepmatz.png","language":"Rust","funding_links":[],"categories":["Integrations"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003enu-jupyter-kernel\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e\n    A \n    \u003ca href=\"https://jupyter.org\"\u003ejupyter\u003c/a\u003e \n    \u003ca href=https://jupyter-client.readthedocs.io\"\u003eraw kernel\u003c/a\u003e \n    for \u003ca href=\"https://www.nushell.sh\"\u003enu\u003c/a\u003e.\n  \u003c/b\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n  [![crates.io Version](https://img.shields.io/crates/v/nu-jupyter-kernel?style=for-the-badge)](https://crates.io/crates/nu-jupyter-kernel)\n  [![Nu Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcptpiepmatz%2Fnu-jupyter-kernel%2Fmain%2FCargo.toml\u0026query=workspace.dependencies%5B'nu-engine'%5D.version\u0026prefix=v\u0026style=for-the-badge\u0026label=Nu%20Version\u0026color=%234E9A06)](https://github.com/nushell/nushell)\n  ![Jupyter Protocol Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcptpiepmatz%2Fnu-jupyter-kernel%2Fmain%2FCargo.toml\u0026query=package.metadata.jupyter.protocol_version\u0026prefix=v\u0026style=for-the-badge\u0026label=Jupyter%20Protocol%20Version\u0026color=%23F37726)\n  [![License](https://img.shields.io/github/license/cptpiepmatz/nu-jupyter-kernel?style=for-the-badge)](https://github.com/cptpiepmatz/nu-jupyter-kernel/blob/main/LICENSE)\n\n\u003c/div\u003e\n\n\n## About\n`nu-jupyter-kernel` is a [Jupyter](https://jupyter.org) kernel specifically for \nexecuting Nu pipelines. \nUnlike most Jupyter kernels that rely on Python, this raw kernel directly \nimplements the Jupyter messaging protocol, allowing direct communication without \nPython intermediaries. \nIt's designed to work seamlessly with Nu, the language utilized by \n[Nushell](https://github.com/nushell/nushell) — \na modern shell that emphasizes structured data.\n\n![screenshot](media/screenshot.png)\n\n## Features\nThe `nu-jupyter-kernel` has several features making it a useful kernel for \nJupyter notebooks:\n\n- **Execution of Nu code:** \n  Directly run Nu pipeplines within your Jupyter notebook.\n\n- **State sharing across cells:** \n  Unlike isolated script execution, the kernel maintains state across different \n  cells using the `nu-engine`.\n\n- **Rich Data Rendering:** \n  Outputs are dynamically rendered in various data types wherever applicable.\n\n- **Inline Value Printing:** \n  Easily print values at any point during cell execution.\n\n- **Controlled External Commands:** \n  By default, external commands are disabled for reproducibility. \n  You can enable them as needed, and they will function as they do in Nushell.\n\n- **Kernel Information:** \n  Access kernel-specific information via the `$nuju` constant.\n\n- **Error representation:** \n  Shell errors are beautifully rendered.\n\n- **Nushell Plugin Compatibility:** \n  Supports Nushell plugins within notebooks, allowing them to be loaded and \n  utilized as in a typical Nushell environment.\n\n- **Plotting Integration:**\n  The kernel directly integrates the `nu_plugin_plotters`, making plots easily \n  accessible.\n\n## Examples\nIn the \"examples\" directory are some notebooks that show how the kernel works.\nOpening the examples on Github also shows a preview of them.\n\n\n## Design Goals\nThe design of the `nu-jupyter-kernel` focuses on the following goals:\n\n- **Reproducibility:**\n  Notebooks should be as reproducible as possible by default.\n\n- **Clarity in dependencies:** \n  Make all dependencies clear and obvious to the user.\n\n- **Script-like behavior:** \n  The kernel behaves largely like a regular Nu script to ensure familiarity.\n\n- **Clear Feature Distinctions:** \n  Clearly indicating any deviations or limitations compared to standard Nu \n  script capabilities to avoid confusion during notebook executions.\n\n## Installation\nTo build the kernel you need to have the rust toolchain installed, check the \n[installation guide on rust's official website](https://www.rust-lang.org/tools/install).\n\nUsing `cargo install --locked nu-jupyter-kernel` you can install the latest release of \nthe kernel.\nIf you want to install the latest version on the git repo, you can install the \nkernel via `cargo install --locked nu-jupyter-kernel --git https://github.com/cptpiepmatz/nu-jupyter-kernel.git`\n\n## Usage\n### Registering the Kernel\nAfter installation, you must register the kernel to make it available within \nJupyter environments. \nThis can be done through the command:\n\n```sh\nnu-jupyter-kernel register\n```\n\nYou can specify the registration scope using `--user` for the current user \n(default) or `--system` for system-wide availability.\n\n### Using the Kernel\n\n- **Jupyter Notebook:** \n  Open Jupyter Notebook, create or open a notebook, and then select \"Nushell\" \n  from the kernel options in the top right corner.\n\n- **Visual Studio Code:**\n  Ensure you have the \n  [Jupyter extension by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) \n  installed. \n  Open a `.ipynb` file, click on \"Select Kernel\", choose \"Jupyter Kernel\", and \n  you should see \"Nushell\" listed. \n\nBoth options may require a restart after registering the kernel.\n\n### Note on Updates\nKernel binary updates do not require re-registration unless the binary's \nlocation changes. \nFor developers, keep in mind that running `cargo run register` and \n`cargo run --release register` will result in different binary locations.\n\n## Version Scheme\nThis crate follows the semantic versioning scheme as required by the\n[Rust documentation](https://doc.rust-lang.org/cargo/reference/semver.html).\nThe version number is represented as `x.y.z+a.b.c`, where `x.y.z` is the version\nof the crate and `a.b.c` is the version of the `nu-engine` that this crate is \nbuilt with.\nThe `+` symbol is used to separate the two version numbers.\n\n\n## Contributing\nContributions are welcome! \nIf you're interested in contributing to the `nu-jupyter-kernel`, you can start \nby opening an issue or a pull request. \nIf you'd like to discuss potential changes or get more involved, join the \nNushell community on Discord. \nInvite links are available when you start Nushell or on their GitHub repository.\n\n## Testing\nThis project uses [`uv`](https://github.com/astral-sh/uv) for integration \ntesting. \nSince tools for executing Jupyter notebooks are not currently available in Rust, \nthe tests are handled via Python.\n\nTo run the tests, follow these steps:\n1. **Register the kernel**:\n  ```nushell\n  cargo run register\n  ```\n2. **Sync Python dependencies:**\n  ```nushell\n  uv sync\n  ```\n3. **Run the tests:**\n  ```nushell\n  uv run pytest\n  ```\n\nMake sure `uv` is installed before running the commands.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcptpiepmatz%2Fnu-jupyter-kernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcptpiepmatz%2Fnu-jupyter-kernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcptpiepmatz%2Fnu-jupyter-kernel/lists"}