| Crates.io | jrep |
| lib.rs | jrep |
| version | 0.1.3 |
| created_at | 2022-11-23 07:12:52.047797+00 |
| updated_at | 2022-11-23 07:12:52.047797+00 |
| description | A command line search tool for Jupyter notebooks |
| homepage | https://github.com/joshua-laughner/jrep |
| repository | https://github.com/joshua-laughner/jrep |
| max_upload_size | |
| id | 721425 |
| size | 88,320 |
jrep is grep for Jupyter notebooks. It is a command line program that can search across
multiple notebooks for specific text, but limit itself to certain types of cells, source text,
output data, or any combination. This is built to avoid grep matching strings of characters
in output data (like images).
64-bit Windows, Mac, and Linux executables are included with the latest release. The simplest
way to install jrep is to download the executable for your computer, unzip it, make the
jrep file executable, and place it somewhere on your PATH.
If you encounter any problems running these, please open an issue here.
You may also download the source code and compile it locally. This
requires Rust be installed, with that, running make release in
the repo will compile the program. The compiled program will be target/release/jrep in the
repo folder.
Once the program is in a directory on your PATH you can call it very similarly to grep. The
minimum is to give it a pattern to search for and one or more files to search. The pattern is treated
as a regular expression. This is implemented with the Rust regex crate, so the syntax it uses is
described here.
example.ipynb for any mention of "CO2":jrep CO2 example.ipynb
jrep -i co2 *.ipynb
\d as a special character
instead of a literal backslash+d.jrep '\d{4}-?\d{2}-?\d{2}' *.ipynb
For a list of available options, use jrep -h or jrep --help. Where practical, jrep mimics grep
command line options.
This is still an early version, so it probably will not work in some cases - some notebooks may be missing
expected elements or have a different structure than expected. Not all grep options have been implemented;
some (like --count and the context options) are planned, others will not be added because they do not make
sense for notebooks.