{ "info": { "author": "Paul Butler", "author_email": "paulgb@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Framework :: IPython", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "|Travis Build Status| |Coveralls| |License| |Version| |Gitter|\r\n\r\n--------------\r\n\r\n``runipy``: run IPython as a script\r\n=====================================\r\n\r\nThe IPython notebook provides an interactive interface to a Python interpreter.\r\n\r\n- **Literate programming**: the IPython notebook is an ideal format for\r\n writing \"literate\" programs, in which the code is part of a larger multi-media\r\n document. ``runipy`` lets you run such programs directly, without first\r\n converting to a pure Python script.\r\n- **Report generation**: ``runipy`` can run the notebook and convert it into HTML\r\n in one go, making it an easy way to automate reports.\r\n- **Data pipeline**: if you use IPython notebooks to create a data pipeline,\r\n ``runipy`` lets you automate that pipeline without losing the notebook\r\n formatting.\r\n\r\nRequirements\r\n------------\r\n\r\n``runipy`` currently supports IPython versions 2.4.x, 3.2.x and the current development\r\nversion of 4.x.\r\n\r\nInstallation\r\n------------\r\n\r\nThe easiest way to install ``runipy`` is with ``pip``::\r\n\r\n $ pip install runipy\r\n\r\nCommand-line use\r\n----------------\r\n\r\nTo run a ``.ipynb`` file as a script, run::\r\n\r\n $ runipy MyNotebook.ipynb\r\n\r\nTo save the output of each cell back to the notebook file, run::\r\n\r\n $ runipy -o MyNotebook.ipynb\r\n\r\nTo save the notebook output as a *new* notebook, run::\r\n\r\n $ runipy MyNotebook.ipynb OutputNotebook.ipynb\r\n\r\nTo run a ``.ipynb`` file and generate an ``HTML`` report, run::\r\n\r\n $ runipy MyNotebook.ipynb --html report.html\r\n\r\nPassing Arguments\r\n-----------------\r\n\r\nYou can pass arguments to the notebook through environment variables.\r\nThe use of environment variables is OS- and shell- dependent, but in a\r\ntypical UNIX-like environment they can be passed on the command line\r\nbefore the program name::\r\n\r\n $ myvar=value runipy MyNotebook.ipynb\r\n\r\nHere is one way this can be done from pure python::\r\n\r\n from os import environ\r\n from subprocess import call\r\n\r\n environ['myvar'] = 'value'\r\n call([\"runipy\", \"MyNotebook.ipynb\"])\r\n\r\nThen in the notebook, to access myvar::\r\n\r\n from os import environ\r\n myvar = environ['myvar']\r\n\r\n``environ`` is just a ``dict``, so you can use ``.get()`` to fall back on\r\na default value::\r\n\r\n from os import environ\r\n myvar = environ.get('myvar', 'default!')\r\n\r\nStdin / Stdout\r\n--------------\r\n\r\n``runipy`` can read stdin and stdout and sit in a UNIX pipeline::\r\n\r\n $ runipy --stdout < MyNotebook.ipynb > OutputNotebook.ipynb\r\n\r\n $ cat MyNotebook.ipynb | runipy --stdout > OutputNotebook.ipynb\r\n\r\n\r\nProgrammatic use\r\n----------------\r\n\r\nIt is also possible to run IPython notebooks from Python, using::\r\n\r\n from runipy.notebook_runner import NotebookRunner\r\n from IPython.nbformat.current import read\r\n\r\n notebook = read(open(\"MyNotebook.ipynb\"), 'json')\r\n r = NotebookRunner(notebook)\r\n r.run_notebook()\r\n\r\nand you can enable ``pylab`` with::\r\n\r\n r = NotebookRunner(notebook, pylab=True)\r\n \r\nThe notebook is stored in the object and can be saved using::\r\n\r\n from IPython.nbformat.current import write\r\n write(r.nb, open(\"MyOtherNotebook.ipynb\", 'w'), 'json')\r\n\r\n`run_notebook()` takes two optional arguments. The first, `skip_exceptions`, \r\ntakes a boolean value (`False` by default). If `True`, exceptions will be ignored\r\nand the notebook will continue to execute cells after encountering an exception.\r\nThe second argument is `progress_callback`, which must be either `None` or a\r\nfunction that takes one argument. This function is called after execution of\r\neach cell with the 0-based index of the cell just evaluated. This can be useful\r\nfor tracking progress of long-running notebooks.\r\n\r\nCredit\r\n------\r\n\r\nPortions of the code are based on code by `Min RK `_\r\n\r\nThanks to Kyle Kelley, Nitin Madnani, George Titsworth, Thomas Robitaille,\r\nAndrey Tatarinov, Matthew Brett, Adam Haney, Nathan Goldbaum, Adam Ginsburg,\r\nGustavo Bragan\u00e7a, Tobias Brandt, Andrea Zonca, Aaron O'Leary, Simon Guillot,\r\nFernando Correia, Takashi Nishibayashi, Simon Conseil, and Thomas French\r\nfor patches, documentation fixes, and suggestions.\r\n\r\n.. |Travis Build Status| image:: https://travis-ci.org/paulgb/runipy.svg?branch=master\r\n :target: https://travis-ci.org/paulgb/runipy\r\n\r\n.. |Coveralls| image:: https://coveralls.io/repos/paulgb/runipy/badge.svg?branch=master&service=github\r\n :target: https://coveralls.io/github/paulgb/runipy?branch=master\r\n\r\n.. |License| image:: https://img.shields.io/badge/license-BSD-blue.svg\r\n :alt: BSD License\r\n :target: https://raw.githubusercontent.com/paulgb/runipy/master/LICENSE\r\n\r\n.. |Version| image:: https://img.shields.io/pypi/v/runipy.svg\r\n :target: https://pypi.python.org/pypi/runipy\r\n\r\n.. |Gitter| image:: https://badges.gitter.im/Join%20Chat.svg\r\n :alt: Join the chat at https://gitter.im/paulgb/runipy\r\n :target: https://gitter.im/paulgb/runipy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/paulgb/runipy", "keywords": "ipython", "license": "BSD 2-Clause", "maintainer": "John Kirkham", "maintainer_email": "jakirkham@gmail.com", "name": "runipy", "package_url": "https://pypi.org/project/runipy/", "platform": "any", "project_url": "https://pypi.org/project/runipy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/paulgb/runipy" }, "release_url": "https://pypi.org/project/runipy/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Run IPython notebooks from the command line", "version": "0.1.5" }, "last_serial": 1775624, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6f966b487344d3adaf6a4a7b7c3efccf", "sha256": "333f4974daa43203e4d0ec4c2486f51d800f9954f5e7ec08d2409ce4863b470a" }, "downloads": -1, "filename": "runipy-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6f966b487344d3adaf6a4a7b7c3efccf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3931, "upload_time": "2013-09-20T03:35:38", "url": "https://files.pythonhosted.org/packages/80/6c/eb7648f0753b053a1ef3cf15f8cdfa3336316b910de26825aa3c6c26deaa/runipy-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "c7ab38c3f8f806859e7f41e45296ebdf", "sha256": "539de2fb918b1d4035ff733bf62b3afd5cca0d5c627c197e9fa0cc0e2a650dae" }, "downloads": -1, "filename": "runipy-0.0.2.tar.gz", "has_sig": false, "md5_digest": "c7ab38c3f8f806859e7f41e45296ebdf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4063, "upload_time": "2013-09-21T21:06:22", "url": "https://files.pythonhosted.org/packages/74/b5/afec793b6bccfd43c88c9ebbf26d9222f430d51573b791841665a5d30cfd/runipy-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "9d37bfd5cb679f978ac38da064360b8e", "sha256": "dcf5a6dd1a2460c2811685232c651023ec03f08b3487d9779d0f25cc2187fb1e" }, "downloads": -1, "filename": "runipy-0.0.3.tar.gz", "has_sig": false, "md5_digest": "9d37bfd5cb679f978ac38da064360b8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4088, "upload_time": "2013-09-29T15:01:11", "url": "https://files.pythonhosted.org/packages/71/32/27341195b41055dc162b30e4c523837f6216ef59920d8f37a2d31d8cffbb/runipy-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "df734b42f0fe4a71738e7ada8701ae9e", "sha256": "d4f893263f49db92c243230cddaab6eff538902ec1c11f73a76736829d01da1c" }, "downloads": -1, "filename": "runipy-0.0.4.tar.gz", "has_sig": false, "md5_digest": "df734b42f0fe4a71738e7ada8701ae9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6306, "upload_time": "2013-11-18T00:28:59", "url": "https://files.pythonhosted.org/packages/1f/5c/ec799d3fa9b02287e9cb8e2c45f647c3d23657e05ef5cb097655d0f6f3b9/runipy-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "4917fe201a8a15ae7e3db1e418e24b7c", "sha256": "540b7a6ee06088584cb48ef62efd3a388cf2773720af4c019a7c233a23a2f34d" }, "downloads": -1, "filename": "runipy-0.0.5.tar.gz", "has_sig": false, "md5_digest": "4917fe201a8a15ae7e3db1e418e24b7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5494, "upload_time": "2014-01-27T23:41:57", "url": "https://files.pythonhosted.org/packages/e3/54/41bc6d8ccc9ab28e502e54561b49986e3b44b8ccb468c6a77d0a2b3d15fd/runipy-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "e6620b3cbe7deaee47afe0273ff09204", "sha256": "7564013a0f01a30245a83db70ed135ae98883ea305282165f821ef57a3488960" }, "downloads": -1, "filename": "runipy-0.0.6.tar.gz", "has_sig": false, "md5_digest": "e6620b3cbe7deaee47afe0273ff09204", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5463, "upload_time": "2014-02-19T18:10:09", "url": "https://files.pythonhosted.org/packages/7b/36/6b356a2dfafa0cc0ce3f2d0904df03852cc225698fc7f1b12446dfe7898f/runipy-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "87089c6c34189b065fbe6f7ef1f2ab41", "sha256": "2a71389fd4acad686c114e834944a2473538a41c0d8fd2b41a861947f87dcb46" }, "downloads": -1, "filename": "runipy-0.0.7.tar.gz", "has_sig": false, "md5_digest": "87089c6c34189b065fbe6f7ef1f2ab41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5476, "upload_time": "2014-02-28T15:12:12", "url": "https://files.pythonhosted.org/packages/60/1a/add89f18deafe38467747e0a22631a3974d7dadde1d8fd5ac1675d637e96/runipy-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "467cb44b95e0313cc860811de4de6bbd", "sha256": "9d3524d463bfdfe0262a3bd6f93f754548a66d8cba3ff33c7900c3e8ea7a4c81" }, "downloads": -1, "filename": "runipy-0.0.8.tar.gz", "has_sig": false, "md5_digest": "467cb44b95e0313cc860811de4de6bbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5529, "upload_time": "2014-03-20T14:55:43", "url": "https://files.pythonhosted.org/packages/a8/40/aa742ab5ce3b2c0f9b853416d1cbeea801c3d505366af2cd4b5dfa41aa6c/runipy-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "39d606993853e2948a0ea092a869e525", "sha256": "7eef89e5f7dd9bec1fd247609309b13c784aa0e2ce9b679ab4170f3fa06292a0" }, "downloads": -1, "filename": "runipy-0.0.9.tar.gz", "has_sig": false, "md5_digest": "39d606993853e2948a0ea092a869e525", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5874, "upload_time": "2014-05-12T13:57:14", "url": "https://files.pythonhosted.org/packages/06/5a/7ea7c43029b58219d59033f4666968aab83e7cf8ff3944ad0ee85e2c290b/runipy-0.0.9.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "0128a860e83b5e23c16603b2bccb5b2e", "sha256": "1cf8a4fdc003019f4d1e830e31ace4710d9fe9f9e5c5278088a127b233a7fe8e" }, "downloads": -1, "filename": "runipy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0128a860e83b5e23c16603b2bccb5b2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6407, "upload_time": "2014-05-18T15:45:30", "url": "https://files.pythonhosted.org/packages/1c/39/198929687319be98df40e3c380a06990ca4455b186a1b6b0babb7655ae92/runipy-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "340125a5e834ef8dda03cec62f3145cb", "sha256": "b957c71182307cd58bcd3b2df54168222326643b161e9099c1708778e5d91e20" }, "downloads": -1, "filename": "runipy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "340125a5e834ef8dda03cec62f3145cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6723, "upload_time": "2014-06-25T22:05:05", "url": "https://files.pythonhosted.org/packages/7d/f4/1d8fc6597d048808bf81d096a7ee731e397daedaf0fae371d1fef89b8e41/runipy-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "dff78baa9d8dddfdca085ef6749c3b04", "sha256": "d799844c6debb832f86f593293dbf560c0759d60da37779b40c6dc60bcf51926" }, "downloads": -1, "filename": "runipy-0.1.2.tar.gz", "has_sig": false, "md5_digest": "dff78baa9d8dddfdca085ef6749c3b04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6837, "upload_time": "2015-01-25T16:16:01", "url": "https://files.pythonhosted.org/packages/42/39/807f6fe7d5b3d515f9a7ce14e53a85f3bcd4354476939644d09b8af66103/runipy-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "376d6f574bae9f485edae5ef40a3795c", "sha256": "4b96cd9bb995d81e479fc037b917819560e1b38c5d7d23cc8023fdf195bb61ed" }, "downloads": -1, "filename": "runipy-0.1.3.tar.gz", "has_sig": false, "md5_digest": "376d6f574bae9f485edae5ef40a3795c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7078, "upload_time": "2015-02-01T17:44:22", "url": "https://files.pythonhosted.org/packages/11/ec/c19109592242048d4aa9e95b1a6205f43a0ba4a2ef607f3c74954019b20b/runipy-0.1.3.tar.gz" } ], "0.1.4": [], "0.1.5": [ { "comment_text": "", "digests": { "md5": "afef5be6b8103b9d7f5ba9d086f25d53", "sha256": "202d6bb19cb77e25df8700b16a8f990f1eba9108cc7a587b320eb622cdae6789" }, "downloads": -1, "filename": "runipy-0.1.5.tar.gz", "has_sig": false, "md5_digest": "afef5be6b8103b9d7f5ba9d086f25d53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24459, "upload_time": "2015-10-19T04:33:55", "url": "https://files.pythonhosted.org/packages/ab/b7/628258778b5b6da373dda3053241bf5f7d80ee65941ad3ad219fb3e9356f/runipy-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "afef5be6b8103b9d7f5ba9d086f25d53", "sha256": "202d6bb19cb77e25df8700b16a8f990f1eba9108cc7a587b320eb622cdae6789" }, "downloads": -1, "filename": "runipy-0.1.5.tar.gz", "has_sig": false, "md5_digest": "afef5be6b8103b9d7f5ba9d086f25d53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24459, "upload_time": "2015-10-19T04:33:55", "url": "https://files.pythonhosted.org/packages/ab/b7/628258778b5b6da373dda3053241bf5f7d80ee65941ad3ad219fb3e9356f/runipy-0.1.5.tar.gz" } ] }