Code Monkey home page Code Monkey logo

Comments (1)

MSeal avatar MSeal commented on June 16, 2024

For context and resolutions from nteract slack thread:

Victor Gomes [11:36 AM]
Hey guys, I am wondering if I can somehow use scrapbook or nteract on a Jupyter notebook to get just the outputs of cells without input. With the objective of saving those to a PDF afterwards? Any help or insight on how this is possible (or if it is) would be much appreciated!

jarmokivekas [1:22 PM]
@victor Gomes For something small you can use Toggle input visibility from each cell toolbar to hide the input in Nteract, and then use File > Export PDF. I often do that to hide code and only show the resulting figures.

Victor Gomes [1:27 PM]
@jarmokivekas that is using the nteract application right? What if I have to use Jupyter notebook
and I need to do that programmatically to scale 😬

jarmokivekas [1:50 PM]
Right, in the Nteract desktop application. You could set the input visibility to be hidden in nteract by programatically editing the json in the ipynb file directrly, but that's probably not the best way...

mseal [1:54 PM]
Scrapbook only saves individual visualizations and data points, not the entire notebook output so it's likely not a good fit for this.

Loading the json with nbformat and editing the metadata before passing to nbconvert to generate a PDF (which is what the Jupyter server uses to do this) isn't unreasonable of a code path. It would require a little wrapper code to do the programatic conversion but nothing crazy.

Victor Gomes [2:40 PM]
Thank you for your answer @MSeal that is good. I talked with my team, it is fine that only individual visualizations can be saved. I do need though to be able to save a scraps_report() or all my scraps in a notebook somehow to be able to serialize and share with someone else (doesn't need to be necessarily in PDF format) where they would be able to just open up these scraps and see them. Any suggestions for that?

mseal [4:55 PM]
@victor Gomes https://github.com/nteract/scrapbook#scraps_report-displays-a-report-about-collected-scraps might satisfy your need. Or you'll need to convert the HTML displays into whatever format you want manually
nteract/scrapbook
A library for recording and reading data in notebooks.
Website
https://nteract-scrapbook.readthedocs.io
Stars
88
nteract/scrapbookOct 21st, 2018Added by GitHub

from scrapbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.