jupyter / nbconvert

Jupyter Notebook Conversion
https://nbconvert.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.75k stars 568 forks source link

Tee cell output to stdout? #374

Open j2kun opened 8 years ago

j2kun commented 8 years ago

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)

takluyver commented 8 years ago

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.

RoyalTS commented 5 years ago

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

RoyalTS commented 5 years ago

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

InnovArul commented 5 years ago

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

MSeal commented 5 years ago

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

RoyalTS commented 5 years ago

Yeah, I've settled on papermill for this.

matthewwardrop commented 5 years ago

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 .

Hoeze commented 3 years ago

Is this feature available yet? Would be useful to track progress in e.g. snakemake.

MSeal commented 3 years ago

@Hoeze I believe general consensus is still to use papermill for output teeing rather than nbconvert.

alonme commented 1 year ago

@MSeal - How is this achieved with papermill?