📦 poetry-jupyter-plugin
overview
This is a really simple plugin to allow you to install your
Poetry virtual environment as a
Jupyter kernel. You may wish to do this to keep your
dependencies locked down for reproducible notebooks, or to set up a single
"data science" notebook for one-off calculations without fiddling about with
installing packages globally or dealing with ipykernel directly.
getting started
Install the plugin with:
$ poetry self add poetry-jupyter-plugin
Then, from within your poetry project:
$ poetry add ipykernel -G dev
$ poetry jupyter install
Remove the kernelspec with:
$ poetry jupyter remove
configuration
By default, the installed kernel will use the name of the project and a default
Poetry icon. To configure these options, add this block to your pyproject.toml:
[tool.jupyter.kernel]
name = "my-cool-kernel"
display = "My cool kernel"
icon = "/path/to/icon.png"
prior art
There are other projects in this space, notably Pathbird's [poetry-kernel].
poetry-kernel installs a single kernelspec globally which then patches the
virtualenv based on the specific project folder that you're running Jupyter in.
This has some pros and cons over this project.
Pros:
- Single kernelspec, avoiding polluting the kernelspec list with lots of specs.
- Easy context switching between projects.
Cons:
- Notebooks have to be in the same folder (or a subfolder from) as the
pyproject.tomlfolder. - Requires forwarding signals from the launcher into Jupyter, introducing a layer of complexity and is brittle to changes in Jupyter protocol/underlying OS.
- Implicit dependency on
ipykernel, and may fail to start without it.
In contrast, this project installs one kernelspec per virtualenv and leaves it
up to Jupyter to launch the kernel normally without interception. This design
decision also allows multiple projects to be based out of one kernel.
Additionally, the tool checks for the existence of ipykernel to make sure
that the kernel can be installed properly.
who?
This was written by patrick kage.
Metadata
Release files for poetry-jupyter-plugin 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| poetry_jupyter_plugin-0.2.2.tar.gz | 119.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| poetry_jupyter_plugin-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 238.6 kB
Release files / poetry_jupyter_plugin-0.2.2.tar.gz
| Download URL | poetry_jupyter_plugin-0.2.2.tar.gz |
|---|---|
| Size | 119.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2266c96d5df294eeb1dce10469c4a23d191d8e24922c0c8d7c79064c8e3f4349
|
|
BLAKE2b-256 checksum How to use checksums |
cbe5cd8c425e82e251852094f8aa916f7de766c561ddf8e8ac7273703a65d883
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.11.4 Darwin/24.1.0
|
Release files / poetry_jupyter_plugin-0.2.2-py3-none-any.whl
| Download URL | poetry_jupyter_plugin-0.2.2-py3-none-any.whl |
|---|---|
| Size | 119.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
27aaed58f6ee1dc21c42491c8975cb27eb6abf9b7b310856ddb8ae23434f2561
|
|
BLAKE2b-256 checksum How to use checksums |
2f71b636ab526db7910570e0d5e0c8a213dd76a44b924d5672ca640ce23dcec6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.11.4 Darwin/24.1.0
|