A set of tools for nb handling
Project description
nb_helpers
A simple tool to clean, test and fix notebooks for your repo
Install
You can install from pypi:
pip install nb_helpers
or get latest:
pip install -e .
Usage
This little library gives you command line tools to clean, test and check your jupyter notebooks.
- Clean: When you call
clean_nbs
it will strip notebooks from the metadata, this helps prevent git conflicts. You can also pass the flag--clear_outs
and also remove cell outputs.
$ nb_helpers.clean_nbs
>
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Notebook Path ┃ Status ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ tests/data/dummy_folder/fail_nb.ipynb │ Ok✔ │
│ tests/data/dummy_folder/test_nb2.ipynb │ Ok✔ │
│ tests/data/dummy_folder/test_nb_all_slow.ipynb │ Ok✔ │
│ tests/data/dummy_folder/test_nb_some_slow.ipynb │ Ok✔ │
│ tests/data/features_nb.ipynb │ Ok✔ │
│ tests/data/test_nb.ipynb │ Ok✔ │
└─────────────────────────────────────────────────┴────────┘
- Summary:
You can get a summary of the notebooks in your project with the
nb_helpers.summary_nbs
function.
$ nb_helpers.summary_nbs
CONSOLE.is_terminal(): True
Writing output to /Users/tcapelle/wandb/nb_helpers/logs/summary.csv
Reading 6 notebooks
┌───┬─────────────────────────────────────────────────┬────────────┬────────────────┬────────────────────────────────────────────────┬────────────┬───────┐
│ # │ nb name │ tracker │ wandb features │ python libs │ colab_cell │ colab │
├───┼─────────────────────────────────────────────────┼────────────┼────────────────┼────────────────────────────────────────────────┼────────────┼───────┤
│ 1 │ tests/data/dummy_folder/fail_nb.ipynb │ │ │ │ │ open │
│ 2 │ tests/data/dummy_folder/test_nb2.ipynb │ │ │ │ │ open │
│ 3 │ tests/data/dummy_folder/test_nb_all_slow.ipynb │ │ │ time │ │ open │
│ 4 │ tests/data/dummy_folder/test_nb_some_slow.ipynb │ │ │ time │ │ open │
│ 5 │ tests/data/features_nb.ipynb │ │ │ typing, itertools │ │ open │
│ 6 │ tests/data/test_nb.ipynb │ 0: tracker │ │ os, sys, logging, pathlib, fastcore, itertools │ 1 │ open │
└───┴─────────────────────────────────────────────────┴────────────┴────────────────┴────────────────────────────────────────────────┴────────────┴───────┘
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nb_helpers-0.1.5.tar.gz
(13.0 kB
view hashes)
Built Distribution
nb_helpers-0.1.5-py3-none-any.whl
(14.4 kB
view hashes)
Close
Hashes for nb_helpers-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5f751484c298b5848ac58669abd08da3131c3240792bcd7b27f95c3dc5cad9d |
|
MD5 | 4190f423a491bd3f569b23c2848f8a62 |
|
BLAKE2b-256 | a64118ca702f47e191f8e724426ca4d483a9820b6c998af5085e127a7cded416 |