Skip to content

Create some extension points for notebook / cell execution #158

@choldgraf

Description

@choldgraf

Description

I think that it would be useful if developers could piggy-back on nbclient and extend its functionality. At the simplest level, I think it'd be useful to have pre and post execution hooks when executing notebooks, where you could access the notebook/cell before and after the nbclient execution.

Benefit

I think that this would be beneficial for a few reason:

  • At a strategic level, the Jupyter Project puts a strong emphasis on extensibility and modularity. This would bring these values into the nbclient project as well.
  • It would allow people to experiment with programmatic execution of notebooks more effectively, without the high-stakes decision of modifying nbclient's core

An example where I think this would be useful is in this forum discussion about in-line markdown execution. If it were possible to extend nbclient in the ways described here, I think that somebody could prototype an in-line markdown execution functionality by creating a package that extends nbclient. (e.g., you could use a pre-execution hook that does something like "if it's a markdown cell, look for in-line execution syntax, if it exists then execute it with the kernel and append the mime-bundle to the markdown cell's metadata).

Implementation

I'm not sure the best place to implement this, but curious first if others would find the functionality useful.

Another possibility is that this would live in a similar package like papermill. In my mind this seems close enough to Jupyter's "core goals" that it'd be best as lightweight extension points in the core package, but I'd be open to arguments the other way!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions