A CLI facility to inspect Python environments.
Project description
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 --full
source = /path/to/your/env/site-packages/stdlib_list/__init__.py:0
version = v0.8.0
in_stdlib = False
name = stdlib_list
Known limitations
wxc
is not able to retrieve the source of compiled code binded into Python. It
should however correctly point to the compiled file that an object is imported
from.
Notes
- the Python api is tested on macOS, Linux, for Python 3.6 and 3.9
wxc
relies on stdlib_list to determine which packages are part of the standard library.- this project was formerly named "whych" and renamed to avoid confusion with the pypi-available package of the same name.
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
Built Distribution
File details
Details for the file wxc-6.1.2.tar.gz
.
File metadata
- Download URL: wxc-6.1.2.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee9cac8885807f459ae3c49c452a0acda5dd24fc6edaf7ddb2da34b77c122207 |
|
MD5 | d64ed4bf2a8d8fa8d7fed7fc30a1b937 |
|
BLAKE2b-256 | 0c903989924b6accf7dc90bf2910b9ccc95c246b2e53550a1c3f47da97af009c |
File details
Details for the file wxc-6.1.2-py3-none-any.whl
.
File metadata
- Download URL: wxc-6.1.2-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4fed4253ee0f7f8bc0a2f00939e6092a6c9e9b8ce3d103efc38a7d9071160cb |
|
MD5 | af9dd08a0a999f86e0ef0e1d72947184 |
|
BLAKE2b-256 | 3b96a15cfa136412c9a02db3d5676490c788add442abd94ff28cb6d35f97f041 |