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
CodeHandlererrorIf the handler fails, may contain a related error message.
error_detailIf the handler fails, may contain a traceback or other details.
failedTrueif the handler failed to modify the docsafe_to_forkWhether it is still safe for the Bokeh server to fork new workers.
Inherited from
HandlererrorIf the handler fails, may contain a related error message.
error_detailIf the handler fails, may contain a traceback or other details.
failedTrueif the handler failed to modify the docsafe_to_forkWhether 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
Documenturl_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
Documenton_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.