Application builder for ipython notebooks
Project description
This command line utility builds a standalone executable installer for a single ipython notebook. It is intended for applications built with ipywidgets. (Not yet tested on osx)
Quickstart
conda install boa constructor nodejs -c conda-forge
pip install widgetron
widgetron -h
How it Works
Builds and packages a minimal electron interface to navigate to localhost:8866 and boot up the voila server
Copies a notebook (specified by -f) into a template python package
Copies the entire contents of the built electron application into the template python package.
Optionally copies a source code directory (specified by -src), if provided, into the template python package.
The package specifies ** for package_data so be sure to clean out any __pycache__ folders and other garbage.
Must be a valid python package (i.e. the folder must contain __init__.py)
Makes a conda-package out of the python package template to hold the notebook, electron app, and source code if provided.
Builds an installer
Conda dependencies are specified with the -deps parameter (see example).
Help
usage: widgetron [-h] [-deps DEPENDENCIES [DEPENDENCIES ...]] [-c CHANNELS [CHANNELS ...]] [-p PORT] [-n NAME] [-o OUTDIR] [-v VERSION] [-src PYTHON_SOURCE_DIR] [-icon ICON] file Creates an electron app for displaying the output cells of an interactive notebook. positional arguments: file Path to notebook to convert. (must be .ipynb) options: -h, --help show this help message and exit -deps DEPENDENCIES [DEPENDENCIES ...], --dependencies DEPENDENCIES [DEPENDENCIES ...] List of conda-forge packages required to run the widget (pip packages are not supported). -c CHANNELS [CHANNELS ...], --channels CHANNELS [CHANNELS ...] List of conda channels required to find specified packages. Order is obeyed, 'local' is always checked first. Default= ['conda-forge',] -p PORT, --port PORT 4-digit port number on which the notebook will be hosted. -n NAME, --name NAME Name of the application (defaults to the notebook name). -o OUTDIR, --outdir OUTDIR App version number. -v VERSION, --version VERSION -src PYTHON_SOURCE_DIR, --python_source_dir PYTHON_SOURCE_DIR This is a shortcut to avoid needing to build a conda package for your source code. Widgetron is basically a big jinja template, if your notebook has `from my_package import my_widget` then you would pass C:/path/to/my_package, and the directory will by copied recursively into a package shell immediately next to the notebook. -icon ICON, --icon ICON Icon for app. Must be a .ico (Windows) or .icns (osx)
Example Usage
git clone https://github.com/JoelStansbury/widgetron.git cd widgetron pip install ./src cd examples widgetron my_notebook.ipynb -src my_package -icon icon.ico -deps numpy matplotlib
Results
After the widgetron command the installer is placed in the current working directory
Running the installer
Startmenu Shortcut
Window
Profit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for widgetron-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a40b711b7c51823ece133858a01fcd5d52da04d0ee9bd2a29f4bfafecc309b88 |
|
MD5 | 202d2e4f47536826ae4b746f137db605 |
|
BLAKE2b-256 | 6ed27385e150c0ef018c42510bbd828f6513c44d5fffd46e7423c399d8c5a2b2 |