Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neutrinoceros/wxc
A command line tool to query source code from your current Python env
https://github.com/neutrinoceros/wxc
developer-tools python python-environment
Last synced: about 6 hours ago
JSON representation
A command line tool to query source code from your current Python env
- Host: GitHub
- URL: https://github.com/neutrinoceros/wxc
- Owner: neutrinoceros
- License: gpl-3.0
- Created: 2020-05-23T20:34:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T17:07:18.000Z (15 days ago)
- Last Synced: 2024-11-07T00:51:08.944Z (10 days ago)
- Topics: developer-tools, python, python-environment
- Language: Python
- Homepage:
- Size: 1000 KB
- Stars: 18
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# wxc
[![PyPI](https://img.shields.io/pypi/v/wxc.svg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/wxc/)
[![](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://github.com/neutrinoceros/wxc/pulls)[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/neutrinoceros/wxc/main.svg)](https://results.pre-commit.ci/latest/github/neutrinoceros/wxc/main)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)`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.## Installation
```shell
$ python -m pip install wxc
```## Usage
Get the version number of a package in your current environment
Locate the file from which a Python package is imported
Locate a specific method's source code
View the source code of function directly from the terminal stdout
`wxc` tries to be helpful when you mistype
For more, run
```shell
$ wxc --help
```## Known limitations
`wxc` is not currently 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.`wxc` should never be installed in isolation (for instance via
[pipx](https://pipxproject.github.io/pipx/)) since it would completely defeat
its purpose.## Notes
- `wxc` is fully tested on macOS, Linux, and partially on Windows
- this project was formerly named "whych" and renamed to avoid confusion with the
pypi-available package of the same name.