{ "info": { "author": "Arulkumar along with @guoquan/github", "author_email": "arul.csecit@ymail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "# runnb - The run-notebook script\n\n`runnb` is a script to run `jupyter` notebooks from the command-line.\nIt is a [`nbconvert`](http://nbconvert.readthedocs.io) API wrapper.\nNotes on executing notebooks can be found [here](http://nbconvert.readthedocs.io/en/latest/execute_api.html).\nYou may also want to see the format specification of `jupyter` notebooks [`nbformat`](http://nbformat.readthedocs.io).\n\nCurrent version of `runnb` is implemented and tested under `python 2, 3` and `jupyter 4.3.0`.\n\n## Installation\n\nTo install pip package,\n\n```bash\npip install runnb\n```\nor to install latest version,\n\n```bash\npip install --upgrade git+https://github.com/InnovArul/runnb\n```\n\n## Usage\n```bash\nrunnb [options] \n```\n\n## Options\n* -h --help Display help message.\n* -e --allow-error Allow error during single cell and continue running.\n* -n --no-stdio Don't recover STDIO to command line. (You may not see printed messages.)\n* -a --allow-not-trusted Run the notebook even not trusted.\n* -t --to=<path/to/notebook.out.ipynb> Save the executed notebook to a specific file.\n\n## Examples\n\nAssume we have a notebook `test.ipynb`.\nSimply run the notebook from command-line:\n```bash\nrunnb test.ipynb\n```\n\nIf we want to run the notebook not being break by possible error in some cell, pass the `--allow-error` flag:\n```bash\nrunnb --allow-error test.ipynb\n```\nOr do it with the shortcut `-e`:\n```bash\nrunnb -e test.ipynb\n```\n\nIf we wanted to export the executed notebook, use `--to`:\n```bash\nrunnb --to=test.out.ipynb test.ipynb\n```\nor using its shortcut `-t`:\n```bash\nrunnb --ttest.out.ipynb test.ipynb\n```\n\nBy default, we recover the output of notebook to the command-line by boardcasting the `input`/`output`/`error` stream. This is done by adding a small snippet of code handling `sys.stdin`, `sys.stdout`, and `sys.stderr`. A tiny `Tee` Class is used to support such behavior. Make sure `tee.py` is in our python search path. If doing this is not preferable in certain scenario, we can turn it off by passing `--no-stdio` flag:\n```bash\nrunnb --no-stdio test.ipynb\n```\nor using its shortcut `-n`:\n```bash\nrunnb -n test.ipynb\n```\nHowever, this could mean we may not see output from the execution on the command-line. It could be a good idea to save those outputs to a output notebook by using `--to` flag:\n```bash\nrunnb --no-stdio --to test.out.ipynb test.ipynb\n```\n\nThe most (no exaggeration) dangerous thing we can try here is to run a *not trusted* notebook. By default, running a not-trusted notebook leads to a `DeprecationWarning` that stop it from running. However, if one insists to, we can pass `--allow-not-trusted` flag to allow running.\n```bash\nrunnb --allow-not-trusted not_trusted.ipynb\n```\nDeprecation message will be displayed but it would not block running. The executed not-trusted notebook could also be saved by using `--to`. We will unsign the outcome of not-trusted notebook and mark it not trusted. However, the best practice is do not run not trusted notebooks. At least we should review the notebook first, and sign it trusted if it is safe. Make sure we understand what is happenning and what we are doing.\n\n## Lib usage\n`runnb(nb_path, allow_errors=False, no_stdio=False, to_file=None)`\n\nRun a notebook from current path.\n\nParameters:\n* `nb_path` (`str`) - path to a notebook.\n* `allow_errors` (`bool`) - Wheither to allow error during single cell and continue running. When set to `True`, the notebook will continue running following cells if error presents in some cell. Default `False`.\n* `no_stdio` (`bool`) - Wheither to stop recovering STDIO to default. When set to `True`, default STDIO (usually command-line) will not be recovered. Results can be found only in the output notebook. Default `False`.\n* `to_file` (`str`) - Path to which file the executed notebook will be saved to. The notebook will not be save if set to `None` or empty string. Default `None`.\n\nRaises:\n* `DeprecationWarning` - Raise if the notebook is not trusted and the warning is not filtered with `warnings` module.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/InnovArul/runnb", "keywords": "jupyter notebook", "license": "", "maintainer": "", "maintainer_email": "", "name": "runnb", "package_url": "https://pypi.org/project/runnb/", "platform": "", "project_url": "https://pypi.org/project/runnb/", "project_urls": { "Homepage": "https://github.com/InnovArul/runnb", "Source": "https://github.com/InnovArul/runnb" }, "release_url": "https://pypi.org/project/runnb/1.0.2/", "requires_dist": null, "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "summary": "A lean utility to run the jupyter notebooks from commandline with stdout outputs", "version": "1.0.2" }, "last_serial": 5135733, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "f78cfbbf0f3a14d4c50c8f2bc6a6ec7e", "sha256": "322195b7acb96a100cfea846945fcd023b473dc5d46fe4514c6b6e74e3416967" }, "downloads": -1, "filename": "runnb-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f78cfbbf0f3a14d4c50c8f2bc6a6ec7e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 11655, "upload_time": "2019-04-12T20:13:44", "url": "https://files.pythonhosted.org/packages/2d/55/394bd1fbd50a81698057d461df702d82a7e4e82545a50d09a98b75aa574e/runnb-1.0.0-py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "2ca5ea249672ca329473e0a332fa4d3a", "sha256": "89ec970967d96b24f90420595970470d4513217575bfdb8bf7477b5543fd2393" }, "downloads": -1, "filename": "runnb-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2ca5ea249672ca329473e0a332fa4d3a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 11690, "upload_time": "2019-04-12T20:37:59", "url": "https://files.pythonhosted.org/packages/98/89/f58f862c48649cf0233422010d389506f76386cbea2e1f2bf9210445e01e/runnb-1.0.1-py3-none-any.whl" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "3b00aae16ea4a2bc374654eed5f30f35", "sha256": "d29e3c2d0669b8aa80261d787be3437c5fecc921aac8a5eb81137998bcf80db3" }, "downloads": -1, "filename": "runnb-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3b00aae16ea4a2bc374654eed5f30f35", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 11703, "upload_time": "2019-04-12T21:27:29", "url": "https://files.pythonhosted.org/packages/fd/a5/a4be414e2cb88d2eea89d7483a23bbfffb14eaa9329b900598744754ad7a/runnb-1.0.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3b00aae16ea4a2bc374654eed5f30f35", "sha256": "d29e3c2d0669b8aa80261d787be3437c5fecc921aac8a5eb81137998bcf80db3" }, "downloads": -1, "filename": "runnb-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3b00aae16ea4a2bc374654eed5f30f35", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 11703, "upload_time": "2019-04-12T21:27:29", "url": "https://files.pythonhosted.org/packages/fd/a5/a4be414e2cb88d2eea89d7483a23bbfffb14eaa9329b900598744754ad7a/runnb-1.0.2-py3-none-any.whl" } ] }