A command line tool to query source code from your current Python env

wxc

wxc (pronounced “which”) allows you to inspect source code in your Python environment from the command line. It is based on the inspect module from the
standard library.

In essence,

$ wxc pandas

is equivalent to

$ python -c "import pandas; print(pandas.__file__)"

wxc can also be used to navigate source code, by locating classes and functions by file:line number

$ wxc pandas.DataFrame
/path/to/your/env/site-packages/pandas/core/frame.py:319

which is extremely convenient when combined with augmented terminal applications such as iterm2.

Installation

$ pip install wxc

Note that wxc should never be installed in isolation (for instance via
pipx) since it would completely defeat
the purpose.

Usage

Examples

$ wxc numpy
/path/to/your/env/site-packages/numpy

$ wxc pandas --version
1.0.3

$ wxc stdlib_list

 

 

 

To finish reading, please visit source site