Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 1.12 KB

README.md

File metadata and controls

55 lines (45 loc) · 1.12 KB

greps

Tests GitHub License codecov PyPI - Python Version Code style

greps is a super simple ipython magic that allow you to use grep over IPython output.

installation

pip install greps

manually loading:

# Inside an IPython shell
%load_ext greps

Automatic loading:

echo "c.InteractiveShellApp.extensions = ['greps']" > ~/.ipython/profile_default/ipython_config.py

Usage

On previous output:

In [1]: {i:i for i in range(3)}
Out[1]: 
{0: 0,
 1: 1,
 2: 2,
}
 
In [2]: %greps 1
Out[2]: ' 1: 1,\n'

On specific output line:

In [1]: 1
Out[1]: 1

In [2]: 2
Out[2]: 2

In [3]: 3
Out[3]: 3

In [4]: 4
Out[4]: 4

In [5]: %greps -l 2 2
Out[5]: '2\n'