Skip to main content

Tools to work with Jupyter notebooks

Project description

nbtoolbelt - Tools to Work with Jupyter Notebooks

  • validate: validate notebooks
  • head: show head or tail of notebooks
  • dump: dump notebook info and source on terminal
  • stats: summarize notebooks with statistics
  • view: view notebook, including all embedded images, LaTeX, and HTML in a browser
  • cat: concatenate multiple notebooks
  • clean: clean notebooks by removing specified elements
  • run: execute notebooks, with pre/post cleaning
  • split: split notebooks into MarkDown, code, and raw
  • punch: punch holes into notebooks and fill them (for creating exercises)

Available as library functions and as configurable command-line scripts.

Installation

pip install nbtoolbelt

Documentation

Documentation is available on Read the Docs.

On the command line, you can use the options -h or --help.

Usage

On the command line:

nbtb [-h] [options] tool [options] nb.ipynb ...

As library: see documentation

Testing

pip install nbtoolbelt[test]

nbtoolbelt comes with a set of automatic test cases for pytest.

Developing

Some useful commands, and where to run them:

  • In nbtoolbelt/docs/,

    • clean build directory: make clean
    • create html documentation tree: make html
    • create pdf documentation: make latexpdf
    • determine size of documentation: wc `find . -name '*.rst'`
  • In nbtoolbelt/test/,

    • run all test cases: pytest .
  • In nbtoolbelt/,

    • test package configuration: python setup.py check -r -s
    • create source distribution and wheel: python setup.py sdist bdist_wheel
  • In nbtoolbelt/dist/

    • create digital signature: gpg --detach-sign -a ...
    • upload to PyPI: twine upload ...
  • In nbtoolbelt/src/,

    • determine size of code: wc `find . -name '*.py'`

Steps to add a feature:

  1. Add issue.

  2. Design interface.

    1. Add (failing) test cases in nbtoolbelt/test/.

    2. Add documentation in nbtoolbelt/docs/.

  3. Implement feature in nbtoolbelt/src/nbtoolbelt/.

  4. Update nbtoolbelt/src/nbtoolbelt/_version.py.

  5. Update CHANGELOG.rst.

  6. Commit and push changes.

  7. Close issue, indicating commit hash.

License

Copyright (c) 2017 - Eindhoven University of Technology, The Netherlands

This software is made available under the terms of the MIT License.

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbtoolbelt-2022.4.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

nbtoolbelt-2022.4-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

Details for the file nbtoolbelt-2022.4.tar.gz.

File metadata

  • Download URL: nbtoolbelt-2022.4.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.2

File hashes

Hashes for nbtoolbelt-2022.4.tar.gz
Algorithm Hash digest
SHA256 6a174ca3cad6bf34fe5d1f40c448a7ea6893786816d52cc8236c1f2bdfbad871
MD5 63349146aad2b75cfae633e2b12edf2a
BLAKE2b-256 70ce4815b5bc376484286afe442628f782f8eaef1f5af7cd122f638f8204b24c

See more details on using hashes here.

File details

Details for the file nbtoolbelt-2022.4-py3-none-any.whl.

File metadata

  • Download URL: nbtoolbelt-2022.4-py3-none-any.whl
  • Upload date:
  • Size: 52.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.2

File hashes

Hashes for nbtoolbelt-2022.4-py3-none-any.whl
Algorithm Hash digest
SHA256 20dc208b224b3cb65f486e01eabb7efcfd92f17a26327d2b577388cdf1060683
MD5 4902ab232c173c1780eac28a2869e109
BLAKE2b-256 eda14dadfb18dc6900dd67984fc0cf2c7390d51e6af75afc2ccedf5ec4f01cde

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page