Skip to main content

A CLI facility to inspect Python environments.

Project description

wxc

PyPI codecov pre-commit.ci status Code style: black

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

  • wxc is tested on macOS, Linux, from Python 3.6 to 3.10
  • for Python versions older than 3.10, 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wxc-6.2.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

wxc-6.2.1-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file wxc-6.2.1.tar.gz.

File metadata

  • Download URL: wxc-6.2.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for wxc-6.2.1.tar.gz
Algorithm Hash digest
SHA256 9d48c97c282eabdd1dfc1045a920396c2b474bddf9da063549321c2aa70c1c6f
MD5 1c30346c5840a4e15ad3725fa46de884
BLAKE2b-256 5f22eee6db8bc9b320ca6a77f5eb06b339087e47608e96f260089f2d1b8569b7

See more details on using hashes here.

File details

Details for the file wxc-6.2.1-py3-none-any.whl.

File metadata

  • Download URL: wxc-6.2.1-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for wxc-6.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1c5070fa39347c5d70d6c5302b746f7394f8721f813d97c4d9c5c5a590acc97
MD5 0dfd99656d5178b44328800316b099b8
BLAKE2b-256 3ea859291a48cd712b2c7b13ff244765ab2a8f5e4bca7236be76cf484c8b4b85

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page