A Common Lisp kernel for Jupyter along with a library for building Jupyter kernels.
View the Project on GitHub yitzchak/common-lisp-jupyter
*page-output*
nil
Output stream sent to Jupyter pager. Available during calls to evaluate-code.
clear
(clear &optional wait)
Send clear output message to frontend.
code-is-complete
(code-is-complete kernel code)
Check code for completeness. Kernel implementations should result one of the permitted values of complete, incomplete, unknown or invalid.
comm
comm
standard-object
:id
:target-name
:kernel
comm-id
(comm-id sb-pcl::object)
command-line
(command-line instance)
Get the command line for an installer instance.
complete-code
(complete-code kernel code cursor-pos)
Complete code at cursor-pos. Successful completion should return three values, first a list of strings, then the cursor start position and finally the cursor end position.
create-comm
(create-comm target-name id data metadata buffers)
enqueue-input
(enqueue-input kernel code)
Add code to input queue.
evaluate-code
(evaluate-code kernel code)
Evaluate code along with paged output. Kernel implementations
must return a list of evaluated results. Each result should be wrapped with an
appropriate result
class instance. Sending the results to the client will be
handled by the calling method.
file
(file path &optional display-data)
Create a result based on a file path. The mime type with automatically be determined from the file extension.
get-comm
(get-comm id)
gif-file
(gif-file path &optional display-data)
Create a GIF image result based on a file path.
handling-errors
(handling-errors
&body
body)
Macro for catching any conditions including quit-conditions during code evaluation.
html
(html value &optional display-data)
Create a HTML result based on an inline value.
inform
(inform level src format-control &rest format-arguments)
inline-result
(inline-result value mime-type &optional display-data)
Create a result based on an inline value.
inline-result
inline-result
result
standard-object
:display-data
:value
:mime-type
inspect-code
(inspect-code kernel code cursor-pos detail-level)
Inspect code at cursor-pos with detail-level. Successful inspection should return a single wrapped result.
install
(install instance)
Install a kernel based on an installer instance.
installer
installer
standard-object
class
— Class that implements the kernel. Used by image based installations.
display-name
— Name of the kernel displayed to the user.
implementation
— Path to specific binary used by the kernel.
kernel-name
— Name of the kernel.
language
— Language that the kernel supports.
local
— Is the installation a local or packaged installation?
local-systems
— List of systems to package into local-projects.
prefix
— Directory to put installed files into. Used by packaging system, should be nil otherwise.
resources
— List of paths of resource files such as icons.
systems
— List of systems to bundle for system installs.
:class
:display-name
:implementation
:kernel-name
:language
:local
:local-systems
:prefix
:resources
:systems
Base installer class.
installer-class
(installer-class sb-pcl::object)
installer-class
(installer-class sb-pcl::new-value sb-pcl::object)
installer-display-name
(installer-display-name sb-pcl::object)
installer-display-name
(installer-display-name sb-pcl::new-value sb-pcl::object)
installer-implementation
(installer-implementation sb-pcl::object)
installer-implementation
(installer-implementation sb-pcl::new-value sb-pcl::object)
installer-kernel-name
(installer-kernel-name sb-pcl::object)
installer-kernel-name
(installer-kernel-name sb-pcl::new-value sb-pcl::object)
installer-language
(installer-language sb-pcl::object)
installer-language
(installer-language sb-pcl::new-value sb-pcl::object)
installer-local
(installer-local sb-pcl::object)
installer-local
(installer-local sb-pcl::new-value sb-pcl::object)
installer-local-systems
(installer-local-systems sb-pcl::object)
installer-local-systems
(installer-local-systems sb-pcl::new-value sb-pcl::object)
installer-path
(installer-path instance &rest parts)
Resolve each of the path parts then combine all into a single path using merge-pathnames.
installer-prefix
(installer-prefix sb-pcl::object)
installer-prefix
(installer-prefix sb-pcl::new-value sb-pcl::object)
installer-resources
(installer-resources sb-pcl::object)
installer-resources
(installer-resources sb-pcl::new-value sb-pcl::object)
installer-systems
(installer-systems sb-pcl::object)
installer-systems
(installer-systems sb-pcl::new-value sb-pcl::object)
jpeg
(jpeg value &optional display-data)
Create a JPEG image result based on an inline value.
jpeg-file
(jpeg-file path &optional display-data)
Create a JPEG image result based on a file path.
json-getf
(json-getf object indicator &optional default)
Safe accessor for the internal JSON format that behaves like getf
kernel
kernel
standard-object
name
— Kernel name. Used as a unique identifier in kernel
description.
version
— Kernel version.
banner
— Banner text used to describe kernel. Used in
kernel_info_reply messages.
language-name
— Display name of implementation language. Used
in kernel_info_reply messages.
language-version
— Version of implementation language. Used in
kernel_info_reply messages.
mime-type
— Default MIME type for source files. Used in
kernel_info_reply messages.
file-extension
— Default file extension for source files. Used
in kernel_info_reply messages.
pygments-lexer
— Name of Pygments lexer for source files. Used
in kernel_info_reply messages.
codemirror-mode
— CodeMirror mode for source files. Used in
kernel_info_reply messages.
help-links
— An association list of help links. The car is the
description and the cdr is URL. Used in kernel_info_reply
messages.
package
— The package in which evaluate-code,
code-is-complete and others are called.
connection-file
— Pathname of connection file.
transport
— Transport protocol from connection file.
ip
— IP address from connection file.
shell-port
— SHELL port from connection file.
stdin-port
— STDIN port from connection file.
iopub-port
— IOPUB port from connection file.
control-port
— CONTROL port from connection file.
hb-port
— HB port from connection file.
signature-scheme
— Signature scheme from connection file.
key
— Signing key from connection file.
prompt-prefix
— String prefix using in standard-output to
indicate the start of prompt.
prompt-suffix
— String suffix using in standard-output to
indicate the end of prompt.
ctx
— pzmq ctx handle.
mac
— Message authification.
hb
— Heartbeat channel.
shell
— SHELL channel.
stdin
— STDIN channel.
iopub
— IOPUB channel.
session
— Session identifier.
input-queue
— Input queue used to feed values into
execute_result payloads.
history
— Kernel history manager.
execution-count
— Kernel execution count.
comms
— Currently open comms.
:sink
:name
:version
:banner
:language-name
:language-version
:mime-type
:file-extension
:pygments-lexer
:codemirror-mode
:help-links
:package
:connection-file
:prompt-prefix
:prompt-suffix
:input-queue
Kernel state representation.
kernel-prompt-prefix
(kernel-prompt-prefix sb-pcl::object)
kernel-prompt-suffix
(kernel-prompt-suffix sb-pcl::object)
latex
(latex value &optional display-data)
Create a LaTeX result based on an inline value.
make-error-result
(make-error-result ename evalue &key quit traceback)
Make a result based on an error. The quit the parameter indicates that the kernel should exit. The handle argument is used by the convenience functions to instantly process the result.
make-file-result
(make-file-result path &key mime-type display-data handle)
Make a result based on a file. The handle argument is used by the convenience functions to instantly process the result.
make-inline-result
(make-inline-result value &key mime-type display-data handle)
Make a result based on an inline value. The handle argument is used by the convenience functions to instantly process the result.
make-lisp-result
(make-lisp-result value &key display-data)
Make a lisp result based on an inline value.
markdown
(markdown value &optional display-data)
Create a Markdown result based on an inline value.
on-comm-close
(on-comm-close comm data metadata buffers)
on-comm-message
(on-comm-message comm data metadata buffers)
on-comm-open
(on-comm-open comm data metadata buffers)
pdf-file
(pdf-file path &optional display-data)
Create a PDF result based on a file path.
png
(png value &optional display-data)
Create a PNG image result based on an inline value.
png-file
(png-file path &optional display-data)
Create a PNG image result based on a file path.
ps-file
(ps-file path &optional display-data)
Create a PostScript result based on a file path.
quit-condition
quit-condition
error
serious-condition
condition
A condition for identifying a request for kernel shutdown.
quit-eval-error-p
(quit-eval-error-p result)
Predicate to determine if result is an quit result.
render
(render result)
Render evaluation result as a mime bundle for execute_result or display_data.
result
result
standard-object
display-data
— Show result as display_data in client.:display-data
Base class for encapsulation of evaluation result.
run-kernel
(run-kernel kernel-class connection-file)
Run a kernel based on a kernel class and a connection file.
send-comm-close
(send-comm-close comm &optional data metadata buffers)
send-comm-message
(send-comm-message comm &optional data metadata buffers)
send-comm-open
(send-comm-open comm &optional data metadata buffers)
send-result
(send-result result)
Send a result either as display data or an execute result.
svg
(svg value &optional display-data)
Create a SVG result based on an inline value.
svg-file
(svg-file path &optional display-data)
Create a SVG result based on a file path.
system-installer
system-installer
installer
standard-object
:class
:display-name
:implementation
:kernel-name
:language
:local
:local-systems
:prefix
:resources
:systems
System installer class.
text
(text value &optional display-data)
Create a plain text result based on an inline value.
user-image-installer
user-image-installer
user-installer
installer
standard-object
:class
:display-name
:implementation
:kernel-name
:language
:local
:local-systems
:prefix
:resources
:systems
User image installer class.
user-installer
user-installer
installer
standard-object
:class
:display-name
:implementation
:kernel-name
:language
:local
:local-systems
:prefix
:resources
:systems
User installer class.