Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: add output filters #11690

Open
paddymul opened this issue Apr 12, 2019 · 1 comment
Open

Feature Request: add output filters #11690

paddymul opened this issue Apr 12, 2019 · 1 comment

Comments

@paddymul
Copy link

I'm working on a notebook showing AWS automation commands. I want to make sure that my AWS_ID (or any other secret info) doesn't leak into the output. For shell commands I can pipe everything through a sed command, for python commands I can't do anything similar. Could a feature be added that allows output from a cell to filtered and modified before being being displayed? I think this is an IPython feature because it seems close to cell magics, if it's a jupyter feature I'd be happy to file a bug there. I'm also happy to implement this feature if I'm given some direction on where it would fit in.

@Carreau
Copy link
Member

Carreau commented Apr 17, 2019

Do you mean when running live, or are you running things in nbconvert.

I see why this would make sens.
I woudl have a look at IPython.core.displayhook in compute_format_data, you will likely be able to intercept a dictionary of mimetype/values and if you look at the plain/text key (and likely the html one for pandas) you should be able to do a search/replace.

If that's the right place it should be relatively easy to add a list callable/filter from the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants