Closed MaicoTimmerman closed 5 years ago
I agree that this would be quite useful to have as an option, and it doesn’t seem like removing the version number has any effect. Probably best done through an optional parameter --strip-version
.
Agree, I have been thinking about this as well. The version dependent keys afaict are the following:
metadata["kernel_spec"]["display_name"]
metadata["kernel_spec"]["name"]
metadata["language_info"]["codemirror_mode"]["version"]
metadata["language_info"]["pygments_lexer"]
metadata["language_info"]["version"]
I'm not super happy hardcoding these values, but assuming the metadata representation is stable it may not be that bad.
For consistency I suggest stripping those by default, unless --keep-version
is given.
For the implementation I think it's time to refactor strip_output
to take an iterable of (hierarchical) keys to strip so we can do away with the many if
s.
I can't promise when I'll have time to work on this, but contributions are welcome!
The
metadata["language_info"]["version"] = ...
causes merge conflicts when using different python versions. While this has no affect on the workings on the notebook, can we also stripout this attribute?