{ "info": { "author": "Christopher Brown", "author_email": "io@henrian.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: IPython", "Framework :: Jupyter", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Version Control", "Topic :: Software Development :: Version Control :: Git" ], "description": "# `nbfilter`\n\n[![PyPI version](https://badge.fury.io/py/nbfilter.svg)](https://pypi.org/project/nbfilter/)\n\nFilter `.ipynb` ([`nbformat`](https://github.com/jupyter/nbformat)) files to improve integration with version control systems (VCS), specifically git.\n\n\n## Setup\n\nInstall from [PyPI](https://pypi.python.org/pypi/nbfilter):\n\n```sh\npip install nbfilter\n```\n\n### Use from the command line:\n\n```sh\npython -m nbfilter.clean < research.ipynb | sponge research.ipynb\n```\n\n\n### Integrate into `git`:\n\nFrom your repository's root directory:\n\nRun the following command to define a filter called `ipynbfilter` in your `.git/config` settings:\n```sh\ngit config filter.ipynbfilter.clean 'python -m nbfilter.clean'\n```\n\nThen run one of the following command sequences to trigger it for all files with the `.ipynb` extension:\n```sh\nprintf '*.ipynb filter=ipynbfilter\\n' >> .gitattributes # Apply filter for all contributors\ngit add .gitattributes\n```\n_or_:\n```sh\nprintf '*.ipynb filter=ipynbfilter\\n' >> .git/info/attributes # Apply filter for just me\n```\n\nTo apply it to files that are already under source control (for example, so that diffing subsequent changes produces more intelligible results):\n```sh\ngit add --renormalize . # (re-)apply filters to all files currently under source control\n```\n_or_:\n```sh\ngit add --renormalize research.ipynb # (re-)apply filters to a single file\n```\n\n\n## References / alternatives\n\n* Min RK's [`nbstripout` gist](https://gist.github.com/minrk/6176788) that started it all (licensed as \"Public Domain\").\n > git pre-commit hook for stripping output from IPython notebooks\n* [`nbstripout`](https://github.com/kynan/nbstripout) is a [PyPI-published](https://pypi.org/project/nbstripout/) package that provides all its functionality through a `nbstripout` console script.\n\n* StackOverflow question: [Using IPython notebooks under version control](https://stackoverflow.com/q/18734739)\n* [Making Git and Jupyter Notebooks play nice](http://timstaley.co.uk/posts/making-git-and-jupyter-notebooks-play-nice/)\n uses [`jq`](https://stedolan.github.io/jq/) instead of Python to do the JSON modifications, for the sake of speed.\n* [Jupyter notebooks and version control](http://droettboom.com/blog/2018/01/18/diffable-jupyter-notebooks/)\n discusses alternatives to the `.ipynb` file format that would natively improve `git diff`'ing\n (specifically, YAML with some additional constraints).\n\n\n## License\n\nCopyright (c) 2018 Christopher Brown. [MIT Licensed](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/chbrown/nbfilter", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "nbfilter", "package_url": "https://pypi.org/project/nbfilter/", "platform": "", "project_url": "https://pypi.org/project/nbfilter/", "project_urls": { "Homepage": "https://github.com/chbrown/nbfilter" }, "release_url": "https://pypi.org/project/nbfilter/1.1.0/", "requires_dist": [ "nbformat (>=4)" ], "requires_python": "", "summary": "Filter .ipynb (nbformat) files to improve integration with version control systems (VCS)", "version": "1.1.0" }, "last_serial": 4313502, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "1347feef7b121cb3b3eb2d2373be7caf", "sha256": "162656c8593a24562abe7829d07dad7b8e68b6ec588ab7ab97e0ab21e0d3fb46" }, "downloads": -1, "filename": "nbfilter-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1347feef7b121cb3b3eb2d2373be7caf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3479, "upload_time": "2018-06-23T22:36:06", "url": "https://files.pythonhosted.org/packages/ce/60/1749af1fadfa13fb71692cb7f9b858e8ba9ff23a2ae03733651713d5c752/nbfilter-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b24c5c55f4e2cf9320c8b949a2bdf514", "sha256": "cd129774be8043a4840063f4502912aace6b456f9da7550500ac67422d87a7bb" }, "downloads": -1, "filename": "nbfilter-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b24c5c55f4e2cf9320c8b949a2bdf514", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3073, "upload_time": "2018-06-23T22:36:07", "url": "https://files.pythonhosted.org/packages/e6/e6/15627e6e43a022a82dd3f2e0f1587ce284bc9ab319476b3076cbfcdf613f/nbfilter-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "52162df119da206efd6f8d41ded9127b", "sha256": "7d9ac488a5c33c5ecd00c3e182bdf8be73b04e687e28d51745d396c51c2ce4b1" }, "downloads": -1, "filename": "nbfilter-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "52162df119da206efd6f8d41ded9127b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4041, "upload_time": "2018-09-26T18:00:53", "url": "https://files.pythonhosted.org/packages/9e/97/52286434d1f9c2ca46fb50bef1df74181e27eb24e7e6bf7ff86cc42388a7/nbfilter-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b78ccbd0766419cb806e1d4e860ede46", "sha256": "2948b56d817dbc0c8212f38dad921e5ddfd496a375ce749bc2dd1583655eb7cf" }, "downloads": -1, "filename": "nbfilter-1.1.0.tar.gz", "has_sig": false, "md5_digest": "b78ccbd0766419cb806e1d4e860ede46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3576, "upload_time": "2018-09-26T18:00:54", "url": "https://files.pythonhosted.org/packages/c4/77/19ef3e2a3790e94d7b2ce9fb04e2208e7238ddaee00355e9f3ba3387d2cb/nbfilter-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "52162df119da206efd6f8d41ded9127b", "sha256": "7d9ac488a5c33c5ecd00c3e182bdf8be73b04e687e28d51745d396c51c2ce4b1" }, "downloads": -1, "filename": "nbfilter-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "52162df119da206efd6f8d41ded9127b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4041, "upload_time": "2018-09-26T18:00:53", "url": "https://files.pythonhosted.org/packages/9e/97/52286434d1f9c2ca46fb50bef1df74181e27eb24e7e6bf7ff86cc42388a7/nbfilter-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b78ccbd0766419cb806e1d4e860ede46", "sha256": "2948b56d817dbc0c8212f38dad921e5ddfd496a375ce749bc2dd1583655eb7cf" }, "downloads": -1, "filename": "nbfilter-1.1.0.tar.gz", "has_sig": false, "md5_digest": "b78ccbd0766419cb806e1d4e860ede46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3576, "upload_time": "2018-09-26T18:00:54", "url": "https://files.pythonhosted.org/packages/c4/77/19ef3e2a3790e94d7b2ce9fb04e2208e7238ddaee00355e9f3ba3387d2cb/nbfilter-1.1.0.tar.gz" } ] }