https://github.com/furechan/where-toy
Utility to locate python modules from the command line
https://github.com/furechan/where-toy
command-line python utility
Last synced: about 2 months ago
JSON representation
Utility to locate python modules from the command line
- Host: GitHub
- URL: https://github.com/furechan/where-toy
- Owner: furechan
- License: mit
- Created: 2022-07-28T20:03:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T19:12:58.000Z (over 1 year ago)
- Last Synced: 2024-11-15T09:48:51.874Z (6 months ago)
- Topics: command-line, python, utility
- Language: Python
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Utility to locate python modules from the command line
Python utility to locate packages or resources in the python path.
The module is a thin layer around `importlib` to display
the location and contents of an installed module or package.
The script exits with an error code if the module is not found.
This is similar to `python -minspect -d` but adds the option
to display the package contents as a tree.## Usage
```console
Usage: python -m where [OPTIONS] MODULELocate python module or resources in the python path
MODULE is the name of a module or package as a fully qualified
python nameOptions:
-r, --recurse Recurse into directory contents
--help Show this message and exit.
```## Examples
```console
> python -mwhere sysconfig
/Users/.../envs/py38/lib/sysconfig.py> python -mwhere pandas
/Users/.../envs/py38/lib/site-packages/pandas/__init__.py> python -mwhere where -r
/Users/../Projects/where-toy/src/where
├── __init__.py
├── __main__.py
└── utils.py
```## Installation
> **Warning**
This project installs a module called `where`
which name is also used by other projects like
[where](https://pypi.org/project/where/).You can install the latest version of this module with `pip
```console
pip install git+ssh://[email protected]/furechan/where-toy.git
```## Related Projects & Resources
- [pyloc](https://github.com/nicolasdespres/pyloc) Locate python object definition in your file-system
- [inspect](https://docs.python.org/3/library/inspect.html#command-line-interface) inspect module command line interface