[
  {
    "path": ".gitignore",
    "content": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\n*.egg-info/\n.installed.cfg\n*.egg\nMANIFEST\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n.hypothesis/\n.pytest_cache/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\ndb.sqlite3\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# pyenv\n.python-version\n\n# celery beat schedule file\ncelerybeat-schedule\n\n# SageMath parsed files\n*.sage.py\n\n# Environments\n.env\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mkdocs documentation\n/site\n\n# mypy\n.mypy_cache/\n"
  },
  {
    "path": ".readthedocs.yml",
    "content": "# .readthedocs.yml\n# Read the Docs configuration file\n# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details\n\n# Required\nversion: 2\n\n# Build documentation in the docs/ directory with Sphinx\nsphinx:\n  configuration: docs/conf.py\n\n# Build documentation with MkDocs\n#mkdocs:\n#  configuration: mkdocs.yml\n\n# Optionally build your docs in additional formats such as PDF\nformats:\n  - pdf\n\n# Optionally set the version of Python and requirements required to build your docs\npython:\n  version: 3.8\n  install:\n    - method: pip\n      path: .\n      extra_requirements:\n        - dev\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "Be cordial or be on your way. --Kenneth Reitz\n\nhttps://www.kennethreitz.org/essays/be-cordial-or-be-on-your-way\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributor's Guide\n\nIf you're reading this, you're probably looking to contribute to nbcommands. *Time is the only real currency*, and the fact that you're considering spending some here is *very* generous of you. Thank you very much!\n\nThis document will help you get started with contributing code, testing (future) and filing issues. If you have any questions, feel free to reach out to [Vinayak Mehta](https://vinayak-mehta.github.io), the author and maintainer.\n\n## Code Of Conduct\n\nThe following quote sums up the **Code Of Conduct**.\n\n   > Be cordial or be on your way. --Kenneth Reitz\n\nAs the [Requests Code Of Conduct](https://github.com/psf/requests/blob/master/CODE_OF_CONDUCT.md) states, **all contributions are welcome**, as long as everyone involved is treated with respect.\n\n## Your first contribution\n\nA great way to start contributing to nbcommands is to pick an issue with the [good first issue](https://github.com/vinayak-mehta/nbcommands/labels/good%20first%20issue) label. If you're unable to find a good first issue, feel free to contact the maintainer.\n\n## Setting up a development environment\n\nTo install the dependencies needed for development, you can use pip:\n\n<pre>\n$ pip install conference-radar[dev]\n</pre>\n\nAlternatively, you can clone the project repository, and install using pip:\n\n<pre>\n$ pip install \".[dev]\"\n</pre>\n\n## Pull Requests\n\n### Submit a pull request\n\nThe preferred workflow for contributing to nbcommands is to fork the [project repository](https://github.com/vinayak-mehta/nbcommands) on GitHub, clone, develop on a branch and then finally submit a pull request. Here are the steps:\n\n1. Fork the project repository. Click on the ‘Fork’ button near the top of the page. This creates a copy of the code under your account on the GitHub.\n\n2. Clone your fork of nbcommands from your GitHub account:\n\n<pre>\n$ git clone https://www.github.com/[username]/nbcommands\n</pre>\n\n3. Create a branch to hold your changes:\n\n<pre>\n$ git checkout -b my-feature\n</pre>\n\nAlways branch out from `master` to work on your contribution. It's good practice to never work on the `master` branch!\n\n**Protip: `git stash` is a great way to save the work that you haven't committed yet, to move between branches.**\n\n4. Work on your contribution. Add changed files using `git add` and then `git commit` them:\n\n<pre>\n$ git add modified_files\n$ git commit\n</pre>\n\n5. Finally, push them to your GitHub fork:\n\n<pre>\n$ git push -u origin my-feature\n</pre>\n\nNow it's time to go to the your fork of nbcommands and create a pull request! You can [follow these instructions](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) to do this.\n\n### Work on your pull request\n\nIt is recommended that your pull request complies with the following rules:\n\n- Make sure your code follows [pep8](http://pep8.org). You should [blacken](https://github.com/psf/black) your code.\n\n- Make sure your commit messages follow [the seven rules of a great git commit message](https://chris.beams.io/posts/git-commit/):\n    - Separate subject from body with a blank line\n    - Limit the subject line to 50 characters\n    - Capitalize the subject line\n    - Do not end the subject line with a period\n    - Use the imperative mood in the subject line\n    - Wrap the body at 72 characters\n    - Use the body to explain what and why vs. how\n\n- Please prefix the title of your pull request with [MRG] (Ready for Merge), if the contribution is complete and ready for a detailed review. An incomplete pull request's title should be prefixed with [WIP] (to indicate a work in progress), and changed to [MRG] when it's complete. A good [task list](https://blog.github.com/2013-01-09-task-lists-in-gfm-issues-pulls-comments/) in the PR description will ensure that other people get a better idea of what it proposes to do, which will also increase collaboration.\n\n- If contributing new functionality, make sure that you add a unit test for it, while making sure that all previous tests pass. nbcommands uses [pytest](https://docs.pytest.org/en/latest/) for testing (future). Tests can be run using:\n\n<pre>\n$ python setup.py test\n</pre>\n\n## Filing Issues\n\n[GitHub issues](https://github.com/vinayak-mehta/nbcommands/issues) are used to keep track of all issues and pull requests. Before opening an issue (which asks a question or reports a bug), please use GitHub search to look for existing issues (both open and closed) that may be similar.\n\n### Bug Reports\n\nIn bug reports, make sure you include:\n\n- Your operating system type and Python version:\n\n<pre>\nimport platform; print(platform.platform())\nimport sys; print('Python', sys.version)\n</pre>\n\n- The complete traceback. Just adding the exception message or a part of the traceback won't help the maintainer fix your issue sooner.\n"
  },
  {
    "path": "HISTORY.md",
    "content": "Release History\n===============\n\nmaster\n------\n\n0.5.1 (2021-06-21)\n------------------\n\n- Minor documentation changes.\n\n0.5.0 (2021-06-21)\n------------------\n\n**Improvements**\n\n- Support directories in nbgrep. [#26](https://github.com/vinayak-mehta/nbcommands/pull/26) by [Min RK](https://github.com/minrk).\n\n0.4.0 (2020-08-01)\n------------------\n\n**Improvements**\n\n- [#3](https://github.com/vinayak-mehta/nbcommands/issues/3) Add nbless. [#4](https://github.com/vinayak-mehta/nbcommands/pull/4) by [Deepu Thomas Philip](https://github.com/deepu-tp).\n- Add Sphinx docs!\n\n**Bugfixes**\n\n- [#19](https://github.com/vinayak-mehta/nbcommands/issues/19) Fix KeyError when execution count is None. [#21](https://github.com/vinayak-mehta/nbcommands/pull/21) by Vinayak Mehta.\n\n0.3.2 (2019-11-02)\n------------------\n\n**Bugfixes**\n\n- Fix black source check. Fix: [1d49970](https://github.com/vinayak-mehta/nbcommands/commit/1d4997076df3cd799e28cc9dcb94ef597dadd940).\n\n0.3.1 (2019-11-02)\n------------------\n\n**Bugfixes**\n\n- [#9](https://github.com/vinayak-mehta/nbcommands/issues/9) nbblack does not ignore jupyter magic cell lines. Fix: [e8aa30b](https://github.com/vinayak-mehta/nbcommands/commit/e8aa30b7bc657d7c921eb633143b2a23a98c6901).\n\n0.3.0 (2019-11-02)\n------------------\n\n**Improvements**\n\n- Add nbblack. ✨ 🍰 ✨\n\n0.2.2 (2019-11-01)\n------------------\n\n<pre>\nHTTPError: 400 Client Error: This filename has already been used, use a different version. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy/\n</pre>\n\n0.2.1 (2019-11-01)\n------------------\n\n**Bugfixes**\n\n* Fix README links.\n\n0.2.0 (2019-11-01)\n------------------\n\n**Improvements**\n\n* Add nbtouch, nbgrep, nbhead, nbtail and nbcat.\n\n0.1.0 (2019-10-31)\n------------------\n\n* Birth!\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2019 Vinayak Mehta\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\">\n   <img src=\"https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/docs/_static/nbcommands.png\" width=\"200\">\n</p>\n\n# nbcommands\n\n[![image](https://readthedocs.org/projects/nbcommands/badge/?version=latest)](https://nbcommands.readthedocs.io/en/latest/) [![image](https://img.shields.io/pypi/v/nbcommands.svg)](https://pypi.org/project/nbcommands/) [![image](https://img.shields.io/pypi/pyversions/nbcommands.svg)](https://pypi.org/project/nbcommands/) [![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nnbcommands bring the goodness of Unix commands to Jupyter notebooks.\n\n## Installation\n\nYou can simply use pip to install nbcommands:\n\n<pre>\n$ pip install nbcommands\n</pre>\n\nor conda:\n\n<pre>\n$ conda install -c conda-forge nbcommands\n</pre>\n\n## Usage\n\nnbcommands installs the following commands which let you interact with your Jupyter notebooks without spinning up a notebook server.\n\n- `nbtouch`: Update the access and modification times of each Jupyter notebook to the current time.\n\n    <pre>\n    $ nbtouch notebook1.ipynb notebook2.ipynb</pre>\n    ![nbtouch](https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/docs/_static/nbtouch.gif)\n\n- `nbgrep`: Search for a pattern in Jupyter notebooks.\n\n    <pre>\n    $ nbgrep \"os\" notebook1.ipynb notebook2.ipynb\n    $ nbgrep \"os\" directory/</pre>\n    ![nbgrep](https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/docs/_static/nbgrep.gif)\n\n- `nbhead`: Print the first 5 cells of a Jupyter notebook to standard output.\n\n    <pre>\n    $ nbhead notebook1.ipynb</pre>\n    ![nbhead](https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/docs/_static/nbhead.gif)\n\n    Note: You can also specify the number of cells you want to print using the `-n` option.\n    <pre>\n    $ nbhead -n 10 notebook1.ipynb</pre>\n\n- `nbtail`: Print the last 5 cells of a Jupyter notebook to standard output.\n\n    <pre>\n    $ nbtail notebook2.ipynb</pre>\n    ![nbtail](https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/docs/_static/nbtail.gif)\n\n    Note: You can also specify the number of cells you want to print using the `-n` option.\n    <pre>\n    $ nbtail -n 10 notebook2.ipynb</pre>\n\n- `nbcat`: Concatenate Jupyter notebooks to standard output.\n\n    <pre>\n    $ nbcat notebook1.ipynb notebook2.ipynb</pre>\n    ![nbcat](https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/docs/_static/nbcat.gif)\n\n    Note: You can create a new notebook by concatenating multiple notebooks using the `-o` option.\n    <pre>\n    $ nbcat notebook1.ipynb notebook2.ipynb -o notebook3.ipynb</pre>\n\n- `nbless`: Print a Jupyter notebook using a pager program.\n\n    <pre>\n    $ nbless notebook1.ipynb</pre>\n    ![nbless](https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/docs/_static/nbless.gif)\n\nAnd some non-Unix goodness,\n\n- `nbblack`: Blacken Jupyter notebooks.\n\n    <pre>\n    $ nbblack notebook1.ipynb notebook2.ipynb</pre>\n    ![nbblack](https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/docs/_static/nbblack.gif)\n\n---\n\nPlanned enhancements:\n\n- `nbstrip`: Strip outputs from Jupyter notebooks.\n- `nbdiff`: Find the diff between two Jupyter notebooks.\n- `nbecho`: Add a code cell to a Jupyter notebook.\n- `nbedit`: Interactively edit a Jupyter notebook.\n- `nbtime`: Run and time a Jupyter notebook.\n- `nbwc`: Print word count for a Jupyter notebook.\n\n## Versioning\n\nnbcommands uses [Semantic Versioning](https://semver.org/). For the available versions, see the tags on this repository.\n\n## License\n\nThis project is licensed under the Apache License, see the [LICENSE](https://raw.githubusercontent.com/vinayak-mehta/nbcommands/master/LICENSE) file for details.\n"
  },
  {
    "path": "docs/Makefile",
    "content": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the environment for the first two.\nSPHINXOPTS    ?=\nSPHINXBUILD   ?= sphinx-build\nSOURCEDIR     = .\nBUILDDIR      = _build\n\n# Put it first so that \"make\" without argument is like \"make help\".\nhelp:\n\t@$(SPHINXBUILD) -M help \"$(SOURCEDIR)\" \"$(BUILDDIR)\" $(SPHINXOPTS) $(O)\n\n.PHONY: help Makefile\n\n# Catch-all target: route all unknown targets to Sphinx using the new\n# \"make mode\" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).\n%: Makefile\n\t@$(SPHINXBUILD) -M $@ \"$(SOURCEDIR)\" \"$(BUILDDIR)\" $(SPHINXOPTS) $(O)\n"
  },
  {
    "path": "docs/_templates/hacks.html",
    "content": "<style type=\"text/css\">\n  div.section h1 {font-size: 210%;}\n  /* \"Quick Search\" should be capitalized. */\n  div#searchbox h3 {text-transform: capitalize;}\n  /* Make the document a little wider, less code is cut-off. */\n  div.document {width: 1008px;}\n  /* Much-improved spacing around code blocks. */\n  div.highlight pre {padding: 11px 14px;}\n  /* Remain Responsive! */\n  @media screen and (max-width: 1008px) {\n    div.sphinxsidebar {display: none;}\n    div.document {width: 100%!important;}\n    /* Have code blocks escape the document right-margin. */\n    div.highlight pre {margin-right: -30px;}\n  }\n</style>"
  },
  {
    "path": "docs/_templates/sidebarintro.html",
    "content": "<p class=\"logo\">\n  <a href=\"{{ pathto(master_doc) }}\">\n    <img class=\"logo\" src=\"{{ pathto('_static/nbcommands.png', 1) }}\"/>\n  </a>\n</p>\n<p>\n<iframe src=\"https://ghbtns.com/github-btn.html?user=vinayak-mehta&repo=nbcommands&type=watch&count=true&size=large\"\n  allowtransparency=\"true\" frameborder=\"0\" scrolling=\"0\" width=\"200px\" height=\"35px\"></iframe>\n</p>\n\n<h3>Useful Links</h3>\n<ul>\n  <li><a href=\"https://github.com/vinayak-mehta/nbcommands\">nbcommands @ GitHub</a></li>\n  <li><a href=\"https://pypi.org/project/nbcommands/\">nbcommands @ PyPI</a></li>\n  <li><a href=\"https://github.com/vinayak-mehta/nbcommands/issues\">Issue Tracker</a></li>\n</ul>"
  },
  {
    "path": "docs/_templates/sidebarlogo.html",
    "content": "<p class=\"logo\">\n  <a href=\"{{ pathto(master_doc) }}\">\n    <img class=\"logo\" src=\"{{ pathto('_static/nbcommands.png', 1) }}\"/>\n  </a>\n</p>\n<p>\n<iframe src=\"https://ghbtns.com/github-btn.html?user=vinayak-mehta&repo=nbcommands&type=watch&count=true&size=large\"\n  allowtransparency=\"true\" frameborder=\"0\" scrolling=\"0\" width=\"200px\" height=\"35px\"></iframe>\n</p>"
  },
  {
    "path": "docs/_themes/.gitignore",
    "content": "*.pyc\n*.pyo"
  },
  {
    "path": "docs/_themes/LICENSE",
    "content": "Copyright (c) 2010 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms of the theme, with or\nwithout modification, are permitted provided that the following conditions\nare met:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n  copyright notice, this list of conditions and the following\n  disclaimer in the documentation and/or other materials provided\n  with the distribution.\n\n* The names of the contributors may not be used to endorse or\n  promote products derived from this software without specific\n  prior written permission.\n\nWe kindly ask you to only use these themes in an unmodified manner just\nfor Flask and Flask-related products, not for unrelated projects.  If you\nlike the visual style and want to use it for your own projects, please\nconsider making some larger changes to the themes (such as changing\nfont faces, sizes, colors or margins).\n\nTHIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "docs/_themes/flask_theme_support.py",
    "content": "# flasky pygments style based on tango style\nfrom pygments.style import Style\nfrom pygments.token import (\n    Keyword,\n    Name,\n    Comment,\n    String,\n    Error,\n    Number,\n    Operator,\n    Generic,\n    Whitespace,\n    Punctuation,\n    Other,\n    Literal,\n)\n\n\nclass FlaskyStyle(Style):\n    background_color = \"#f8f8f8\"\n    default_style = \"\"\n\n    styles = {\n        # No corresponding class for the following:\n        # Text:                    \"\", # class:  ''\n        Whitespace: \"underline #f8f8f8\",  # class: 'w'\n        Error: \"#a40000 border:#ef2929\",  # class: 'err'\n        Other: \"#000000\",  # class 'x'\n        Comment: \"italic #8f5902\",  # class: 'c'\n        Comment.Preproc: \"noitalic\",  # class: 'cp'\n        Keyword: \"bold #004461\",  # class: 'k'\n        Keyword.Constant: \"bold #004461\",  # class: 'kc'\n        Keyword.Declaration: \"bold #004461\",  # class: 'kd'\n        Keyword.Namespace: \"bold #004461\",  # class: 'kn'\n        Keyword.Pseudo: \"bold #004461\",  # class: 'kp'\n        Keyword.Reserved: \"bold #004461\",  # class: 'kr'\n        Keyword.Type: \"bold #004461\",  # class: 'kt'\n        Operator: \"#582800\",  # class: 'o'\n        Operator.Word: \"bold #004461\",  # class: 'ow' - like keywords\n        Punctuation: \"bold #000000\",  # class: 'p'\n        # because special names such as Name.Class, Name.Function, etc.\n        # are not recognized as such later in the parsing, we choose them\n        # to look the same as ordinary variables.\n        Name: \"#000000\",  # class: 'n'\n        Name.Attribute: \"#c4a000\",  # class: 'na' - to be revised\n        Name.Builtin: \"#004461\",  # class: 'nb'\n        Name.Builtin.Pseudo: \"#3465a4\",  # class: 'bp'\n        Name.Class: \"#000000\",  # class: 'nc' - to be revised\n        Name.Constant: \"#000000\",  # class: 'no' - to be revised\n        Name.Decorator: \"#888\",  # class: 'nd' - to be revised\n        Name.Entity: \"#ce5c00\",  # class: 'ni'\n        Name.Exception: \"bold #cc0000\",  # class: 'ne'\n        Name.Function: \"#000000\",  # class: 'nf'\n        Name.Property: \"#000000\",  # class: 'py'\n        Name.Label: \"#f57900\",  # class: 'nl'\n        Name.Namespace: \"#000000\",  # class: 'nn' - to be revised\n        Name.Other: \"#000000\",  # class: 'nx'\n        Name.Tag: \"bold #004461\",  # class: 'nt' - like a keyword\n        Name.Variable: \"#000000\",  # class: 'nv' - to be revised\n        Name.Variable.Class: \"#000000\",  # class: 'vc' - to be revised\n        Name.Variable.Global: \"#000000\",  # class: 'vg' - to be revised\n        Name.Variable.Instance: \"#000000\",  # class: 'vi' - to be revised\n        Number: \"#990000\",  # class: 'm'\n        Literal: \"#000000\",  # class: 'l'\n        Literal.Date: \"#000000\",  # class: 'ld'\n        String: \"#4e9a06\",  # class: 's'\n        String.Backtick: \"#4e9a06\",  # class: 'sb'\n        String.Char: \"#4e9a06\",  # class: 'sc'\n        String.Doc: \"italic #8f5902\",  # class: 'sd' - like a comment\n        String.Double: \"#4e9a06\",  # class: 's2'\n        String.Escape: \"#4e9a06\",  # class: 'se'\n        String.Heredoc: \"#4e9a06\",  # class: 'sh'\n        String.Interpol: \"#4e9a06\",  # class: 'si'\n        String.Other: \"#4e9a06\",  # class: 'sx'\n        String.Regex: \"#4e9a06\",  # class: 'sr'\n        String.Single: \"#4e9a06\",  # class: 's1'\n        String.Symbol: \"#4e9a06\",  # class: 'ss'\n        Generic: \"#000000\",  # class: 'g'\n        Generic.Deleted: \"#a40000\",  # class: 'gd'\n        Generic.Emph: \"italic #000000\",  # class: 'ge'\n        Generic.Error: \"#ef2929\",  # class: 'gr'\n        Generic.Heading: \"bold #000080\",  # class: 'gh'\n        Generic.Inserted: \"#00A000\",  # class: 'gi'\n        Generic.Output: \"#888\",  # class: 'go'\n        Generic.Prompt: \"#745334\",  # class: 'gp'\n        Generic.Strong: \"bold #000000\",  # class: 'gs'\n        Generic.Subheading: \"bold #800080\",  # class: 'gu'\n        Generic.Traceback: \"bold #a40000\",  # class: 'gt'\n    }\n"
  },
  {
    "path": "docs/conf.py",
    "content": "# -*- coding: utf-8 -*-\n#\n# nbcommands documentation build configuration file, created by\n# sphinx-quickstart on Tue Jul 19 13:44:18 2016.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport os\nimport sys\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#\n# sys.path.insert(0, os.path.abspath('..'))\n\n# Insert nbcommands's path into the system.\nsys.path.insert(0, os.path.abspath(\"..\"))\nsys.path.insert(0, os.path.abspath(\"_themes\"))\n\nimport nbcommands\n\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#\n# needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = []\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\n# source_suffix = ['.rst', '.md']\nsource_suffix = \".rst\"\n\n# The encoding of source files.\n#\n# source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = \"index\"\n\n# General information about the project.\nproject = u\"conference-radar\"\ncopyright = u\"2021, Vinayak Mehta\"\nauthor = u\"Vinayak Mehta\"\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n\n# The short X.Y version.\nversion = nbcommands.__version__\n# The full version, including alpha/beta/rc tags.\nrelease = nbcommands.__version__\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#\n# today = ''\n#\n# Else, today_fmt is used as the format for a strftime call.\n#\n# today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This patterns also effect to html_static_path and html_extra_path\nexclude_patterns = [\"_build\"]\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#\n# default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\nadd_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\nadd_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#\n# show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = \"flask_theme_support.FlaskyStyle\"\n\n# A list of ignored prefixes for module index sorting.\n# modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n# keep_warnings = False\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = True\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nhtml_theme = \"alabaster\"\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\nhtml_theme_options = {\n    \"show_powered_by\": False,\n    \"github_user\": \"vinayak-mehta\",\n    \"github_repo\": \"nbcommands\",\n    \"github_banner\": True,\n    \"show_related\": False,\n    \"note_bg\": \"#FFF59C\",\n}\n\n# Add any paths that contain custom themes here, relative to this directory.\n# html_theme_path = []\n\n# The name for this set of Sphinx documents.\n# \"<project> v<release> documentation\" by default.\n#\n# html_title = None\n\n# A shorter title for the navigation bar.  Default is the same as html_title.\n#\n# html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#\n# html_logo = None\n\n# The name of an image file (relative to this directory) to use as a favicon of\n# the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\nhtml_favicon = \"_static/favicon.ico\"\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = [\"_static\"]\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#\n# html_extra_path = []\n\n# If not None, a 'Last updated on:' timestamp is inserted at every page\n# bottom, using the given strftime format.\n# The empty string is equivalent to '%b %d, %Y'.\n#\n# html_last_updated_fmt = None\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\nhtml_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\nhtml_sidebars = {\n    \"index\": [\n        \"sidebarintro.html\",\n        \"relations.html\",\n        \"sourcelink.html\",\n        \"searchbox.html\",\n        \"hacks.html\",\n    ],\n    \"**\": [\n        \"sidebarlogo.html\",\n        \"localtoc.html\",\n        \"relations.html\",\n        \"sourcelink.html\",\n        \"searchbox.html\",\n        \"hacks.html\",\n    ],\n}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#\n# html_additional_pages = {}\n\n# If false, no module index is generated.\n#\n# html_domain_indices = True\n\n# If false, no index is generated.\n#\n# html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#\n# html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\nhtml_show_sourcelink = False\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\nhtml_show_sphinx = False\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\nhtml_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it.  The value of this option must be the\n# base URL from which the finished HTML is served.\n#\n# html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n# html_file_suffix = None\n\n# Language to be used for generating the HTML full-text search index.\n# Sphinx supports the following languages:\n#   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'\n#   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'\n#\n# html_search_language = 'en'\n\n# A dictionary with options for the search language support, empty by default.\n# 'ja' uses this config value.\n# 'zh' user can custom change `jieba` dictionary path.\n#\n# html_search_options = {'type': 'default'}\n\n# The name of a javascript file (relative to the configuration directory) that\n# implements a search results scorer. If empty, the default will be used.\n#\n# html_search_scorer = 'scorer.js'\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = \"nbcommandsdoc\"\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n    # The paper size ('letterpaper' or 'a4paper').\n    #\n    # 'papersize': 'letterpaper',\n    # The font size ('10pt', '11pt' or '12pt').\n    #\n    # 'pointsize': '10pt',\n    # Additional stuff for the LaTeX preamble.\n    #\n    # 'preamble': '',\n    # Latex figure (float) alignment\n    #\n    # 'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n    (\n        master_doc,\n        \"nbcommands.tex\",\n        u\"nbcommands documentation\",\n        u\"Vinayak Mehta\",\n        \"manual\",\n    )\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#\n# latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#\n# latex_use_parts = False\n\n# If true, show page references after internal links.\n#\n# latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#\n# latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#\n# latex_appendices = []\n\n# It false, will not define \\strong, \\code,     itleref, \\crossref ... but only\n# \\sphinxstrong, ..., \\sphinxtitleref, ... To help avoid clash with user added\n# packages.\n#\n# latex_keep_old_macro_names = True\n\n# If false, no module index is generated.\n#\n# latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [(master_doc, \"nbcommands\", u\"nbcommands documentation\", [author], 1)]\n\n# If true, show URL addresses after external links.\n#\n# man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n    (\n        master_doc,\n        \"nbcommands\",\n        u\"nbcommands documentation\",\n        author,\n        \"nbcommands\",\n        \"One line description of project.\",\n        \"Miscellaneous\",\n    )\n]\n\n# Documents to append as an appendix to all manuals.\n#\n# texinfo_appendices = []\n\n# If false, no module index is generated.\n#\n# texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#\n# texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#\n# texinfo_no_detailmenu = False\n"
  },
  {
    "path": "docs/index.rst",
    "content": ".. nbcommands documentation master file, created by\n   sphinx-quickstart on Sat Aug  1 03:02:35 2020.\n   You can adapt this file completely to your liking, but it should at least\n   contain the root `toctree` directive.\n\nnbcommands — Unix commands for Jupyter notebooks\n================================================\n\n.. image:: https://readthedocs.org/projects/nbcommands/badge/?version=latest\n    :target: https://nbcommands.readthedocs.io/en/latest/\n    :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/v/nbcommands.svg\n    :target: https://pypi.org/project/nbcommands/\n\n.. image:: https://img.shields.io/pypi/pyversions/nbcommands.svg\n    :target: https://pypi.org/project/nbcommands/\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/ambv/black\n\nnbcommands bring the goodness of Unix commands to Jupyter notebooks.\n\nInstallation\n------------\n\nYou can simply use pip to install nbcommands::\n\n    $ pip install nbcommands\n\nor conda::\n\n    $ conda install -c conda-forge nbcommands\n\nUsage\n-----\n\nnbcommands installs the following commands which let you interact with your Jupyter notebooks without spinning up a notebook server.\n\nnbtouch\n^^^^^^^\n\nUpdate the access and modification times of each Jupyter notebook to the current time,\nor create empty notebook files where none exist::\n\n    $ nbtouch notebook1.ipynb notebook2.ipynb\n\n.. image:: _static/nbtouch.gif\n\nnbgrep\n^^^^^^\n\nSearch for a pattern in Jupyter notebooks::\n\n    $ nbgrep \"os\" notebook1.ipynb notebook2.ipynb\n    $ nbgrep \"os\" directory/\n\n.. image:: _static/nbgrep.gif\n\nnbhead\n^^^^^^\n\nPrint the first 5 cells of a Jupyter notebook to standard output::\n\n    $ nbhead notebook1.ipynb\n\n.. image:: _static/nbhead.gif\n\n.. note:: You can also specify the number of cells you want to print using the ``-n`` option.\n\nnbtail\n^^^^^^\n\nPrint the last 5 cells of a Jupyter notebook to standard output::\n\n    $ nbtail notebook2.ipynb\n\n.. image:: _static/nbtail.gif\n\n.. note:: You can also specify the number of cells you want to print using the ``-n`` option.\n\nnbcat\n^^^^^\n\nConcatenate Jupyter notebooks to standard output::\n\n    $ nbcat notebook1.ipynb notebook2.ipynb\n\n.. image:: _static/nbcat.gif\n\n.. note:: You can create a new notebook by concatenating multiple notebooks using the ``-o`` option.\n\nnbless\n^^^^^^\n\nPrint a Jupyter notebook using a pager program::\n\n    $ nbless notebook1.ipynb\n\n.. image:: _static/nbless.gif\n\nAnd some non-Unix goodness,\n\nnbblack\n^^^^^^^\n\nBlacken Jupyter notebooks::\n\n    $ nbblack notebook1.ipynb notebook2.ipynb\n\n.. image:: _static/nbblack.gif\n\n---\n\nPlanned enhancements:\n\n- ``nbstrip``: Strip outputs from Jupyter notebooks.\n- ``nbdiff``: Find the diff between two Jupyter notebooks.\n- ``nbecho``: Add a code cell to a Jupyter notebook.\n- ``nbedit``: Interactively edit a Jupyter notebook.\n- ``nbtime``: Run and time a Jupyter notebook.\n- ``nbwc``: Print word count for a Jupyter notebook.\n\nVersioning\n----------\n\nnbcommands uses `Semantic Versioning <https://semver.org/>`_. For the available versions, see the tags on the GitHub repository.\n\nLicense\n-------\n\nThis project is licensed under the Apache License, see the `LICENSE <https://github.com/vinayak-mehta/nbcommands/blob/master/LICENSE>`_ file for details.\n"
  },
  {
    "path": "docs/make.bat",
    "content": "@ECHO OFF\r\n\r\npushd %~dp0\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\nset SOURCEDIR=.\r\nset BUILDDIR=_build\r\n\r\nif \"%1\" == \"\" goto help\r\n\r\n%SPHINXBUILD% >NUL 2>NUL\r\nif errorlevel 9009 (\r\n\techo.\r\n\techo.The 'sphinx-build' command was not found. Make sure you have Sphinx\r\n\techo.installed, then set the SPHINXBUILD environment variable to point\r\n\techo.to the full path of the 'sphinx-build' executable. Alternatively you\r\n\techo.may add the Sphinx directory to PATH.\r\n\techo.\r\n\techo.If you don't have Sphinx installed, grab it from\r\n\techo.http://sphinx-doc.org/\r\n\texit /b 1\r\n)\r\n\r\n%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%\r\ngoto end\r\n\r\n:help\r\n%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%\r\n\r\n:end\r\npopd\r\n"
  },
  {
    "path": "nbcommands/__init__.py",
    "content": "# -*- coding: utf-8 -*-\n\nfrom .__version__ import __version__\n"
  },
  {
    "path": "nbcommands/__version__.py",
    "content": "# -*- coding: utf-8 -*-\n\nVERSION = (0, 5, 1)\nPRERELEASE = None  # alpha, beta or rc\nREVISION = None\n\n\ndef generate_version(version, prerelease=None, revision=None):\n    version_parts = [\".\".join(map(str, version))]\n    if prerelease is not None:\n        version_parts.append(\"-{}\".format(prerelease))\n    if revision is not None:\n        version_parts.append(\".{}\".format(revision))\n    return \"\".join(version_parts)\n\n\n__title__ = \"nbcommands\"\n__description__ = \"Unix commands for Jupyter notebooks.\"\n__url__ = \"https://github.com/vinayak-mehta/nbcommands\"\n__version__ = generate_version(VERSION, prerelease=PRERELEASE, revision=REVISION)\n__author__ = \"Vinayak Mehta\"\n__author_email__ = \"vmehta94@gmail.com\"\n__license__ = \"Apache 2.0\"\n"
  },
  {
    "path": "nbcommands/_black.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport re\n\nimport black\nimport click\nimport nbformat\n\nfrom . import __version__\n\n\ndef _cells(nb):\n    \"\"\"Yield all cells in an nbformat-insensitive manner\n\n    Source: https://github.com/kynan/nbstripout/blob/master/nbstripout/_utils.py#L27\n    \"\"\"\n    if nb.nbformat < 4:\n        for ws in nb.worksheets:\n            for cell in ws.cells:\n                yield cell\n    else:\n        for cell in nb.cells:\n            yield cell\n\n\n@click.command(name=\"nbblack\")\n@click.version_option(version=__version__)\n@click.argument(\"file\", nargs=-1)\n@click.pass_context\ndef _black(ctx, *args, **kwargs):\n    \"\"\"Blacken Jupyter notebooks.\"\"\"\n    file_count = len(kwargs[\"file\"])\n    black_file_count = 0\n\n    for file in kwargs[\"file\"]:\n        with open(file, \"r\") as f:\n            nb = nbformat.read(f, as_version=4)\n\n        black_flag = False\n        pinfo_flag = False\n        pattern = re.compile(\"^\\?\")\n        # Source: https://neuralcoder.science/Black-Jupyter/\n        for cell in _cells(nb):\n            if cell.cell_type == \"code\":\n                source = cell.source\n                source = re.sub(\"^%\", \"#%\", source, flags=re.M)\n                source = re.sub(\"^!\", \"#!\", source, flags=re.M)\n                if pattern.match(source):\n                    pinfo_flag = True\n                    source = \"#\" + source\n                black_source = black.format_str(source, mode=black.FileMode())\n                black_source = re.sub(\"^#%\", \"%\", black_source, flags=re.M)\n                black_source = re.sub(\"^#!\", \"!\", black_source, flags=re.M)\n                if pinfo_flag:\n                    black_source = black_source[1:]\n                black_source = black_source.strip()\n                if cell.source != black_source:\n                    black_flag = True\n                cell.source = black_source\n\n        if black_flag:\n            click.echo(\"reformatted {}\".format(file))\n            black_file_count += 1\n\n        with open(file, \"w\") as f:\n            nbformat.write(nb, f, version=4)\n\n    click.echo(\"All done! ✨ 🍰 ✨\")\n    if black_file_count:\n        s = \"s\" if black_file_count > 1 else \"\"\n        click.echo(\"{} file{} reformatted.\".format(black_file_count, s))\n    else:\n        s = \"s\" if file_count > 1 else \"\"\n        click.echo(\"{} file{} left unchanged.\".format(file_count, s))\n"
  },
  {
    "path": "nbcommands/_cat.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport os\n\nimport click\nimport nbformat\n\nfrom . import __version__\nfrom .terminal import display\n\n\n@click.command(name=\"nbcat\")\n@click.version_option(version=__version__)\n@click.option(\"-o\", \"--output\", help=\"Output file path.\")\n@click.argument(\"file\", nargs=-1)\n@click.pass_context\ndef cat(ctx, *args, **kwargs):\n    \"\"\"Concatenate Jupyter notebooks to standard output.\"\"\"\n    # Source: https://github.com/jbn/nbmerge\n    merged, metadata = None, []\n\n    for file in kwargs[\"file\"]:\n        with open(file, \"r\") as f:\n            nb = nbformat.read(f, as_version=4)\n\n        metadata.append(nb.metadata)\n\n        if merged is None:\n            merged = nb\n        else:\n            merged.cells.extend(nb.cells)\n\n    merged_metadata = {}\n    for meta in reversed(metadata):\n        merged_metadata.update(meta)\n    merged.metadata = merged_metadata\n\n    if kwargs[\"output\"] is not None:\n        with open(kwargs[\"output\"], \"w\") as f:\n            nbformat.write(merged, f, version=4)\n    else:\n        click.echo(\"\\n\".join(display(merged.cells)))\n"
  },
  {
    "path": "nbcommands/_grep.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport pathlib\nimport re\n\nimport click\nimport nbformat\nfrom colorama import Fore, Style\n\nfrom . import __version__\n\n\ndef color(s, c, style=\"bright\"):\n    color_map = {\n        \"black\": Fore.BLACK,\n        \"red\": Fore.RED,\n        \"green\": Fore.GREEN,\n        \"yellow\": Fore.YELLOW,\n        \"blue\": Fore.BLUE,\n        \"magenta\": Fore.MAGENTA,\n        \"cyan\": Fore.CYAN,\n        \"white\": Fore.WHITE,\n    }\n    style_map = {\n        \"dim\": Style.DIM,\n        \"normal\": Style.NORMAL,\n        \"bright\": Style.BRIGHT,\n    }\n\n    return color_map[c] + style_map[style] + s + Style.RESET_ALL\n\n\n@click.command(name=\"nbgrep\")\n@click.version_option(version=__version__)\n@click.argument(\"pattern\")\n@click.argument(\"file\", nargs=-1, type=click.Path(exists=True), required=True)\n@click.pass_context\ndef grep(ctx, *args, **kwargs):\n    \"\"\"Search for a pattern in Jupyter notebooks.\"\"\"\n    pattern = kwargs[\"pattern\"]\n    \n    def collect_files():\n        \"\"\"generator for paths\n        \n        FILE can be individual files or directories.\n        If it's a directory, find all .ipynb files in the directory.\n        \"\"\"\n        for path in kwargs[\"file\"]:\n            path = pathlib.Path(path)\n            if path.is_dir():\n                for filename in path.glob(\"**/*.ipynb\"):\n                    yield filename\n            else:\n                yield path\n\n    for file in collect_files():\n        filename = str(file)\n        with file.open(\"r\") as f:\n            nb = nbformat.read(f, as_version=4)\n\n        for cell_n, cell in enumerate(nb.cells):\n            for line_n, line in enumerate(cell.source.split(\"\\n\")):\n                search = re.search(pattern, line)\n                if search is not None:\n                    first, last = search.span()\n                    match = color(line[first:last], \"red\")\n                    click.echo(\n                        color(\":\", \"cyan\").join(\n                            [\n                                color(filename, \"white\", style=\"normal\"),\n                                color(\"cell {}\".format(cell_n + 1), \"green\"),\n                                color(\"line {}\".format(line_n + 1), \"green\"),\n                                line.replace(pattern, match),\n                            ]\n                        )\n                    )\n"
  },
  {
    "path": "nbcommands/_head.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport click\nimport nbformat\n\nfrom . import __version__\nfrom .terminal import display\n\n\n@click.command(name=\"nbhead\")\n@click.version_option(version=__version__)\n@click.option(\n    \"-n\",\n    \"--lines\",\n    default=5,\n    help=\"Print the first INTEGER lines instead of the first 5.\",\n)\n@click.argument(\"file\")\n@click.pass_context\ndef head(ctx, *args, **kwargs):\n    \"\"\"Print the first 5 cells of a Jupyter notebook to standard output.\"\"\"\n    with open(kwargs[\"file\"], \"r\") as f:\n        nb = nbformat.read(f, as_version=4)\n\n    n = kwargs[\"lines\"]\n    cells = nb.cells[:n]\n    click.echo(\"\\n\".join(display(cells)))\n"
  },
  {
    "path": "nbcommands/_less.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport click\nimport nbformat\n\nfrom . import __version__\nfrom .terminal import display\n\n\n@click.command(name=\"nbless\")\n@click.version_option(version=__version__)\n@click.argument(\"file\", type=click.File(\"rb\"), default=\"-\")\n@click.pass_context\ndef less(ctx, *args, **kwargs):\n    \"\"\"View the Jupyter notebook to standard output via a Pager\"\"\"\n\n    nb = nbformat.read(kwargs[\"file\"], as_version=4)\n    click.echo_via_pager(\"\\n\".join(display(nb.cells)))\n"
  },
  {
    "path": "nbcommands/_tail.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport click\nimport nbformat\n\nfrom . import __version__\nfrom .terminal import display\n\n\n@click.command(name=\"nbtail\")\n@click.version_option(version=__version__)\n@click.option(\n    \"-n\",\n    \"--lines\",\n    default=5,\n    help=\"Print the last INTEGER lines instead of the last 5.\",\n)\n@click.argument(\"file\")\n@click.pass_context\ndef tail(ctx, *args, **kwargs):\n    \"\"\"Print the last 5 cells of a Jupyter notebook to standard output.\"\"\"\n    with open(kwargs[\"file\"], \"r\") as f:\n        nb = nbformat.read(f, as_version=4)\n\n    n = kwargs[\"lines\"]\n    cells = nb.cells[-n:]\n    click.echo(\"\\n\".join(display(cells)))\n"
  },
  {
    "path": "nbcommands/_touch.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport os\nfrom pathlib import Path\n\nimport click\nimport nbformat\n\nfrom . import __version__\n\n\n@click.command(name=\"nbtouch\")\n@click.version_option(version=__version__)\n@click.argument(\"file\", nargs=-1)\n@click.pass_context\ndef touch(ctx, *args, **kwargs):\n    \"\"\"Update the access and modification times of each Jupyter notebook to the current time.\n\n    If FILE does not exist, it will be created as an empty notebook.\n    \"\"\"\n    for file in kwargs[\"file\"]:\n        if not os.path.exists(file):\n            nb = nbformat.v4.new_notebook()\n            with open(file, \"w\") as f:\n                nbformat.write(nb, f, version=4)\n        else:\n            Path(file).touch()\n"
  },
  {
    "path": "nbcommands/terminal.py",
    "content": "# -*- coding: utf-8 -*-\n\nfrom colorama import Fore, Style\n\nfrom pygments import highlight\nfrom pygments.lexers import PythonLexer\nfrom pygments.formatters import TerminalTrueColorFormatter\n\n\ndef display(cells):\n    output = []\n\n    for cell in cells:\n        prompt = \"\"\n        # TODO: show more cell types\n        if cell[\"cell_type\"] == \"code\":\n            execution_count = cell.get(\"execution_count\")\n            execution_count = execution_count and execution_count or \" \"\n            prompt = (\n                Fore.GREEN\n                + Style.BRIGHT\n                + \"In [{}]: \".format(execution_count)\n                + Style.RESET_ALL\n            )\n        code = highlight(cell.source, PythonLexer(), TerminalTrueColorFormatter())\n        output.append(prompt + code)\n\n    return output\n"
  },
  {
    "path": "setup.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport os\nfrom setuptools import find_packages\n\n\nhere = os.path.abspath(os.path.dirname(__file__))\nabout = {}\nwith open(os.path.join(here, \"nbcommands\", \"__version__.py\"), \"r\") as f:\n    exec(f.read(), about)\n\nwith open(\"README.md\", \"r\") as f:\n    readme = f.read()\n\n\nrequires = [\n    \"black>=19.10b0\",\n    \"Click>=7.0\",\n    \"colorama>=0.4.1\",\n    \"nbformat>=4.4.0\",\n    \"Pygments>=2.4.2\",\n]\ndev_requires = [\"Sphinx>=2.2.1\"]\ndev_requires = dev_requires + requires\n\n\ndef setup_package():\n    metadata = dict(\n        name=about[\"__title__\"],\n        version=about[\"__version__\"],\n        description=about[\"__description__\"],\n        long_description=readme,\n        long_description_content_type=\"text/markdown\",\n        url=about[\"__url__\"],\n        author=about[\"__author__\"],\n        author_email=about[\"__author_email__\"],\n        license=about[\"__license__\"],\n        packages=find_packages(exclude=(\"tests\",)),\n        install_requires=requires,\n        extras_require={\"dev\": dev_requires},\n        entry_points={\n            \"console_scripts\": [\n                \"nbblack = nbcommands._black:_black\",\n                \"nbtouch = nbcommands._touch:touch\",\n                \"nbgrep = nbcommands._grep:grep\",\n                \"nbhead = nbcommands._head:head\",\n                \"nbtail = nbcommands._tail:tail\",\n                \"nbcat = nbcommands._cat:cat\",\n                \"nbless = nbcommands._less:less\",\n            ]\n        },\n        classifiers=[\n            # Trove classifiers\n            # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers\n            \"License :: OSI Approved :: Apache Software License\",\n            \"Programming Language :: Python :: 3.6\",\n            \"Programming Language :: Python :: 3.7\",\n            \"Programming Language :: Python :: 3.8\",\n            \"Programming Language :: Python :: 3.9\",\n        ],\n    )\n\n    try:\n        from setuptools import setup\n    except ImportError:\n        from distutils.core import setup\n\n    setup(**metadata)\n\n\nif __name__ == \"__main__\":\n    setup_package()\n"
  },
  {
    "path": "tests/test.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"data\": {\n      \"text/plain\": [\n       \"'/home/vinayak/dev/nbcommands/tests'\"\n      ]\n     },\n     \"execution_count\": 2,\n     \"metadata\": {},\n     \"output_type\": \"execute_result\"\n    }\n   ],\n   \"source\": [\n    \"os.getcwd()\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": []\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.6.9\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "tests/test_nbcommands.py",
    "content": ""
  }
]