@@ -3,12 +3,18 @@ Kernel providers
3
3
================
4
4
5
5
.. note ::
6
- This is a new interface under development. Not all Jupyter applications
7
- use this yet. See :ref: `kernelspecs ` for the established way of discovering
8
- kernel types.
6
+ This is a new interface under development, and may still change.
7
+ Not all Jupyter applications use this yet.
8
+ See :ref: `kernelspecs ` for the established way of discovering kernel types.
9
+
10
+ Creating a kernel provider
11
+ ==========================
9
12
10
13
By writing a kernel provider, you can extend how Jupyter applications discover
11
- and start kernels. To do so, subclass
14
+ and start kernels. For example, you could find kernels in an environment system
15
+ like conda, or kernels on remote systems which you can access.
16
+
17
+ To write a kernel provider, subclass
12
18
:class: `jupyter_client.discovery.KernelProviderBase `, giving your provider an ID
13
19
and overriding two methods.
14
20
@@ -47,8 +53,8 @@ called *oblong*::
47
53
if not which('oblong-kernel'):
48
54
return # Check it's available
49
55
50
- # Two variants - for a real kernel, these could be different
51
- # environments
56
+ # Two variants - for a real kernel, these could be something like
57
+ # different conda environments.
52
58
yield 'standard', {
53
59
'display_name': 'Oblong (standard)',
54
60
'language': {'name': 'oblong'},
@@ -85,8 +91,9 @@ Finding kernel types
85
91
====================
86
92
87
93
To find and start kernels in client code, use
88
- :class: `jupyter_client.discovery.KernelFinder `. This has a similar API to kernel
89
- providers, but it wraps a set of kernel providers. The kernel names it works
94
+ :class: `jupyter_client.discovery.KernelFinder `. This uses multiple kernel
95
+ providers to find available kernels. Like a kernel provider, it has methods
96
+ ``find_kernels `` and ``make_manager ``. The kernel names it works
90
97
with have the provider ID as a prefix, e.g. ``oblong/rounded `` (from the example
91
98
above).
92
99
@@ -116,8 +123,8 @@ above).
116
123
117
124
.. automethod :: make_manager
118
125
119
- Included kernel providers
120
- =========================
126
+ Kernel providers included in `` jupyter_client ``
127
+ ===============================================
121
128
122
129
``jupyter_client `` includes two kernel providers:
123
130
@@ -135,9 +142,9 @@ Kernel instance
135
142
Its state includes a namespace and an execution counter.
136
143
137
144
Kernel type
138
- Allows starting multiple, initially similar kernel instances. The kernel type
139
- entails the combination of software to run the kernel, and the context in
140
- which it starts . For instance, one kernel type may be associated with one
145
+ The software to run a kernel instance, along with the context in which a
146
+ kernel starts. One kernel type allows starting multiple, initially similar
147
+ kernel instances . For instance, one kernel type may be associated with one
141
148
conda environment containing ``ipykernel ``. The same kernel software in
142
149
another environment would be a different kernel type. Another software package
143
150
for a kernel, such as ``IRkernel ``, would also be a different kernel type.
0 commit comments