bokeh.application.handlers.notebook¶
Provide a Bokeh Application Handler to build up documents by running
the code from Jupyter notebook (.ipynb
) files.
This handler is configured with the filename of a Jupyter notebook. When a
Bokeh application calls modify_doc
, the code from all the notebook cells
is collected and executed to process a new Document for a session. When the
notebook code is executed, the Document being modified will be available as
curdoc
, and any optionally provided args
will be available as
sys.argv
.
- class NotebookHandler(*, filename: PathLike, argv: List[str] = [], package: ModuleType | None = None)[source]¶
A Handler that uses code in a Jupyter notebook for modifying Bokeh Documents.
Public Data Attributes:
Inherited from
CodeHandler
error
If the handler fails, may contain a related error message.
error_detail
If the handler fails, may contain a traceback or other details.
failed
True
if the handler failed to modify the docsafe_to_fork
Whether it is still safe for the Bokeh server to fork new workers.
Inherited from
Handler
error
If the handler fails, may contain a related error message.
error_detail
If the handler fails, may contain a traceback or other details.
failed
True
if the handler failed to modify the docsafe_to_fork
Whether it is still safe for the Bokeh server to fork new workers.
Public Methods:
__init__
(*, filename[, argv, package])Keywords:
Inherited from
CodeHandler
__init__
(*, filename[, argv, package])Keywords:
modify_document
(doc)Run Bokeh application code to update a
Document
url_path
()The last path component for the basename of the configured filename.
Inherited from
Handler
__init__
(*, filename[, argv, package])Keywords:
modify_document
(doc)Run Bokeh application code to update a
Document
on_server_loaded
(server_context)Execute code when the server is first started.
on_server_unloaded
(server_context)Execute code when the server cleanly exits.
on_session_created
(session_context)Execute code when a new session is created.
on_session_destroyed
(session_context)Execute code when a session is destroyed.
process_request
(request)Processes incoming HTTP request returning a dictionary of additional data to add to the session_context.
static_path
()Return a path to app-specific static resources, if applicable.
url_path
()The last path component for the basename of the configured filename.