Nbconvert: Tee cell output to stdout?

Created on 27 Aug 2016  路  7Comments  路  Source: jupyter/nbconvert

Hey nbconvert folks, I've got another question:

I've been using nbconvert's execute preprocessor to run some jupyter notebooks from the command line, and I've been wondering if there's a way to tee the cell output to stdout as the notebook runs. Is this currently possible with nbconvert, and if not would it be feasible to add this feature? (I'd be happy to submit a PR)

Most helpful comment

This would be great to have. Has there been any progress on this? Is it even on anyone's agenda?

All 7 comments

No, I don't think it's currently possible, but I think it would be a feasible thing to add. Look out for #360, which also changes the relevant code now - if you try to fix this in parallel, the PRs will clash.

This would be great to have. Has there been any progress on this? Is it even on anyone's agenda?

Not a native solution but this does what you want it to do: https://github.com/guoquan/runnb

Just an addition to @RoyalTS's comment. You can install runnb using pip:
pip install runnb
https://pypi.org/project/runnb

Also https://papermill.readthedocs.io/en/latest/ has an option to tee outputs, though papermill only does notebook-to-notebook execution (it wraps nbconvert)

Yeah, I've settled on papermill for this.

For anyone looking for not only tee'd output, but also access to the variables created by the notebook, I've created an in-process runner here: https://gist.github.com/matthewwardrop/fe2148923048baabe14edacb2eda0b74 .

Was this page helpful?
0 / 5 - 0 ratings