{ "info": { "author": "Miki Tebeka", "author_email": "miki@353solutions.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# nuclio Jupyter Export\n\n\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nConvert Jupyter notebook to Python code that can run as [nuclio](https://nuclio.io/) handler\n\n## Usage\n\nWhen developing, import `Context` and `Event` from `nucilo` and use it to\ngenerate a mock context and request.\n\n```python\n# nuclio: ignore\nfrom nuclio import Context, Event\n\ncontext = Context()\nevent = Event(body='Hello Nuclio')\n# your code goes here\n```\n\nIn the cell you'd like to become the handler, added the comment `#\nnuclio:handler`. If there's a specific line you'd like to be the returned one -\nadded `# nuclio:return` at the end of it.\n\nCells containing `# nuclio: ignore` comment will be commented out in the export\nprocess.\n\nNow choose `File/Download as/Nuclio` in Jupyter notebook\n\n![](doc/menu.png)\n\nOr you can run\n\n```\njupyter nbconvert --to nuclio example.ipynb\n```\n\n\nThis will create `example.py` with your code wrapped in handler function and all\ncells with `# nuclio: ignore` commented out.\n\n### Example\n\n![](doc/example.png)\n\nWill generate\n\n```python\n# coding: utf-8\n\n# In[1]:\ndef greeting(name):\n return 'Hi ' + name + '. How are you?'\n\n# In[2]:\ndefault_name = 'Dave'\n\n# In[3]:\n# # nuclio:ignore\n# from nuclio import Context, Event\n# context = Context()\n# event = Event(body=default_name)\n\n# In[4]:\ndef handler(context, event):\n # nuclio:handler\n return greeting(event.body)\n```\n\n## Try It Out\n\nYou can build a docker image and try it out\n\n### Build\n\n $ docker build -t jupyter-nuclio .\n\n### Run\n\n $ docker run -p 8888:8888 jupyter-nuclio\n\nThen open your browser at http://localhost:8888 and enter the password `nuclio`\nwhen prompted.\n\n\n## Developing\n\nWe're using [pipenv](https://docs.pipenv.org/) as package manager. To install\ndependencies run\n\n $ pipenv sync -d\n\nTo run the tests run\n\n $ pipenv run python -m pytest -v tests\n\n## Licence\n\nApache 2.0 (see [LICENSE.txt](LICENSE.txt))\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/nuclio/nuclio-jupyter", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "nuclio", "package_url": "https://pypi.org/project/nuclio/", "platform": "", "project_url": "https://pypi.org/project/nuclio/", "project_urls": { "Homepage": "https://github.com/nuclio/nuclio-jupyter" }, "release_url": "https://pypi.org/project/nuclio/0.1.0/", "requires_dist": [ "ipython (>=6.4.0)", "jupyter (>=1.0.0)", "traitlets (>=4.3.2)" ], "requires_python": "", "summary": "Convert Jupyter notebook to nuclio", "version": "0.1.0" }, "last_serial": 4105178, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a2a50074a0a802c555b5eeca7a21b721", "sha256": "84f3977ff059499e4ca64371c0191aad78a132da443853b2b5329192190d2ffa" }, "downloads": -1, "filename": "nuclio-0.1.0-py3.7.egg", "has_sig": false, "md5_digest": "a2a50074a0a802c555b5eeca7a21b721", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 11427, "upload_time": "2018-07-26T16:00:09", "url": "https://files.pythonhosted.org/packages/c0/dd/2e8dd6bfe1d1da2415749e43e3890c301560e466b25555e039dd10c023f2/nuclio-0.1.0-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "58421d00fca35be102bede9cc3280ca3", "sha256": "b7ea848e9195994e6d87ab1af0625e62523473bee9de0a164a30e3ceacd59965" }, "downloads": -1, "filename": "nuclio-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "58421d00fca35be102bede9cc3280ca3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7025, "upload_time": "2018-07-26T16:00:08", "url": "https://files.pythonhosted.org/packages/44/6e/fd8475d89c770cbca3d45257177312d13a544cbe9bfd4281f7d6e06e3c6a/nuclio-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e6e5c1cfab3721cc550ee199841bc4c", "sha256": "622ca683be4acb5819680c71071143852811b2a115d01d2ebc50cc7d498772f4" }, "downloads": -1, "filename": "nuclio-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0e6e5c1cfab3721cc550ee199841bc4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 108525, "upload_time": "2018-07-26T16:00:11", "url": "https://files.pythonhosted.org/packages/2e/f5/8e805ef3fba72d00926a7ca95f852d3a19dd249e9cce1ebbe9de1f16994b/nuclio-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a2a50074a0a802c555b5eeca7a21b721", "sha256": "84f3977ff059499e4ca64371c0191aad78a132da443853b2b5329192190d2ffa" }, "downloads": -1, "filename": "nuclio-0.1.0-py3.7.egg", "has_sig": false, "md5_digest": "a2a50074a0a802c555b5eeca7a21b721", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 11427, "upload_time": "2018-07-26T16:00:09", "url": "https://files.pythonhosted.org/packages/c0/dd/2e8dd6bfe1d1da2415749e43e3890c301560e466b25555e039dd10c023f2/nuclio-0.1.0-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "58421d00fca35be102bede9cc3280ca3", "sha256": "b7ea848e9195994e6d87ab1af0625e62523473bee9de0a164a30e3ceacd59965" }, "downloads": -1, "filename": "nuclio-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "58421d00fca35be102bede9cc3280ca3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7025, "upload_time": "2018-07-26T16:00:08", "url": "https://files.pythonhosted.org/packages/44/6e/fd8475d89c770cbca3d45257177312d13a544cbe9bfd4281f7d6e06e3c6a/nuclio-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e6e5c1cfab3721cc550ee199841bc4c", "sha256": "622ca683be4acb5819680c71071143852811b2a115d01d2ebc50cc7d498772f4" }, "downloads": -1, "filename": "nuclio-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0e6e5c1cfab3721cc550ee199841bc4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 108525, "upload_time": "2018-07-26T16:00:11", "url": "https://files.pythonhosted.org/packages/2e/f5/8e805ef3fba72d00926a7ca95f852d3a19dd249e9cce1ebbe9de1f16994b/nuclio-0.1.0.tar.gz" } ] }