{ "info": { "author": "Andrea Zonca", "author_email": "code@andreazonca.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "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": "=====\nnbenv\n=====\n\n\n.. image:: https://img.shields.io/pypi/v/nbenv.svg\n :target: https://pypi.python.org/pypi/nbenv\n\n.. image:: https://img.shields.io/travis/zonca/nbenv.svg\n :target: https://travis-ci.org/zonca/nbenv\n\nStore conda environment package list inside Notebook documents\n\nThis package provides a hook for the Jupyter Notebook that saves metadata about the\nconda environment (equivalent of `conda env export`) inside the Notebook `.ipynb` file\neverytime that the Notebook is saved.\nIt also supports packages installed inside the conda environment with `pip`.\n\nOnce such Jupyter Notebook is shared, another user can inspect the environment where\nit ran:\n\n.. code-block:: bash\n\n $ nbenv --extract my_notebook.ipynb\n\n name: test_input_env\n channels:\n - defaults\n - conda-forge\n dependencies:\n - ca-certificates=2017.08.26=h1d4fec5_0\n - certifi=2017.7.27.1=py35h19f42a1_0\n - decorator=4.1.2=py35h3a268aa_0\n - ipykernel=4.6.1=py35h29d130c_0\n - ipython=6.1.0=py35h1b71439_1\n - ipython_genutils=0.2.0=py35hc9e07d0_0\n - jupyter_client=5.1.0=py35h2bff583_0\n - pip:\n - ipython-genutils==0.2.0\n - jupyter-client==5.1.0\n\nAnd re-create the same environment (includes install of IPython Kernel):\n\n.. code-block:: bash\n\n $ nbenv my_notebook.ipynb --name reconstructed_env\n $ source activate reconstructed_env\n $ jupyter notebook\n\nThe environment metadata will be preserved if the Notebook file is modified by a Jupyter Notebook session\nwith no ``nbenv`` installed.\n\nInstall\n--------\n\nInstall the package with `pip install nbenv`\n\nInstall the Jupyter Notebook hook in your `.jupyter/jupyter_notebook_config.py`:\n\n.. code-block:: python\n\n try:\n from nbenv import save_conda_environment\n c.FileContentsManager.pre_save_hook = save_conda_environment\n except ImportError:\n print(\"nbenv package not found: automatic saving of conda environment disabled\")\n\nImplementation details\n----------------------\n\nThe `pre_save_hook` is automatically triggered by the Jupyter Notebook before saving the Notebook\nto disk.\nIt identifies the conda environment being run checking the KernelSpec and then calls ``conda env export``\nand saves the output in ``[\"content\"][\"metadata\"][\"conda_environment\"]`` in the ``.ipynb`` JSON.\n\nThe ``nbenv`` command line tool can then extract that and use ``conda create`` to a new environment.\n\nCredits\n---------\n\nDesign of this package was conceived during discussion at the `Container Analysis Environments Workshop`_\nheld at NCSA in August 2017.\n\n.. _`Container Analysis Environments Workshop`: https://nationaldataservice.atlassian.net/wiki/spaces/NDSC/pages/37284774/Container+Analysis+Environments+Workshop\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zonca/nbenv", "keywords": "nbenv", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "nbenv", "package_url": "https://pypi.org/project/nbenv/", "platform": "", "project_url": "https://pypi.org/project/nbenv/", "project_urls": { "Homepage": "https://github.com/zonca/nbenv" }, "release_url": "https://pypi.org/project/nbenv/0.1.4/", "requires_dist": [ "nbformat", "jupyter-client" ], "requires_python": "", "summary": "Store conda environment package list inside Notebook documents", "version": "0.1.4" }, "last_serial": 3369599, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "c52fb5fc58cffe7a2affc4b2a3b2f4dd", "sha256": "6bfcd770cc75bf9bb5968af692a79ce4a5042b996b89737027c118176ff8c88f" }, "downloads": -1, "filename": "nbenv-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c52fb5fc58cffe7a2affc4b2a3b2f4dd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7911, "upload_time": "2017-11-27T23:47:45", "url": "https://files.pythonhosted.org/packages/8e/66/aa85ce2824db43850e9e92c97c812698feb0d735d5c48b95c146c69c5182/nbenv-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97f2d0c8a5f06956695729e429281d05", "sha256": "a6f08fcde34b7174d982eebcee0f150bc9c25a7b8a15298493900c2f2aab12b3" }, "downloads": -1, "filename": "nbenv-0.1.4.tar.gz", "has_sig": false, "md5_digest": "97f2d0c8a5f06956695729e429281d05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14488, "upload_time": "2017-11-27T23:47:51", "url": "https://files.pythonhosted.org/packages/8b/0d/0d1581bd19287db3719f09eace46003745ab60f62440cbd220d760853c07/nbenv-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c52fb5fc58cffe7a2affc4b2a3b2f4dd", "sha256": "6bfcd770cc75bf9bb5968af692a79ce4a5042b996b89737027c118176ff8c88f" }, "downloads": -1, "filename": "nbenv-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c52fb5fc58cffe7a2affc4b2a3b2f4dd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7911, "upload_time": "2017-11-27T23:47:45", "url": "https://files.pythonhosted.org/packages/8e/66/aa85ce2824db43850e9e92c97c812698feb0d735d5c48b95c146c69c5182/nbenv-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97f2d0c8a5f06956695729e429281d05", "sha256": "a6f08fcde34b7174d982eebcee0f150bc9c25a7b8a15298493900c2f2aab12b3" }, "downloads": -1, "filename": "nbenv-0.1.4.tar.gz", "has_sig": false, "md5_digest": "97f2d0c8a5f06956695729e429281d05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14488, "upload_time": "2017-11-27T23:47:51", "url": "https://files.pythonhosted.org/packages/8b/0d/0d1581bd19287db3719f09eace46003745ab60f62440cbd220d760853c07/nbenv-0.1.4.tar.gz" } ] }