I'd love to write a script that could be integrated into Davos as a CLI entrypoint, and provide a tool that people could use to "davos-enhance" a notebook automatically.
The use case I'm imagining is you have a Jupyter notebook you want to share with someone, and you want to turn it into a "davos-enhanced notebook" to more easily share it in a reproducible way. So you open a terminal and run davos enhance path/to/notebook.ipynb. The script then:
- adds a new cell at the top of the notebook that
%pip installs and imports davos
- parses the code in the notebook and replaces all
import statements with equivalent smuggle statements
- adds onion comments next to each
smuggle statement that specify the package versions installed in your environment
The davos enhance command could support various options to do things like:
- add a
davos.require_python() call before the first smuggle statement
- not add onion comments for certain (or any) packages
- create a copy of the notebook rather than modifying the original
- enable or set various
davos.<foo> options before smuggling packages
I'd love to write a script that could be integrated into Davos as a CLI entrypoint, and provide a tool that people could use to "davos-enhance" a notebook automatically.
The use case I'm imagining is you have a Jupyter notebook you want to share with someone, and you want to turn it into a "davos-enhanced notebook" to more easily share it in a reproducible way. So you open a terminal and run
davos enhance path/to/notebook.ipynb. The script then:%pip installs andimportsdavosimportstatements with equivalentsmugglestatementssmugglestatement that specify the package versions installed in your environmentThe
davos enhancecommand could support various options to do things like:davos.require_python()call before the firstsmugglestatementdavos.<foo>options before smuggling packages