This release is a pre-release and may not be stable for production use.
yield-module-names-and-python-file-paths
Recursively traverses a source directory and yields tuples of Python module names as used in import statements and their corresponding file paths.
Features
- Handles packages.
- Skips hidden files and directories.
- Useful for code analysis tools.
Installation
pip install yield-module-names-and-python-file-paths
Usage
Suppose your project has this structure:
src/
├── foo.py
├── bar.py
├── subpkg/
│ ├── __init__.py
│ └── utils.py
└── scripts/
└── tool.py
You can enumerate the modules:
from yield_module_names_and_python_file_paths import yield_module_names_and_python_file_paths
for module_name, python_file_path in yield_module_names_and_python_file_paths('src'):
print(module_name, '->', python_file_path)
Output:
foo -> myproject/foo.py
bar -> myproject/bar.py
subpkg -> myproject/subpkg/__init__.py
subpkg.utils -> myproject/subpkg/utils.py
scripts.tool -> myproject/scripts/tool.py
Contributing
Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.
License
This project is licensed under the MIT License.
Metadata
Release files for yield-module-names-and-python-file-paths 0.1.0a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| yield_module_names_and_python_file_paths-0.1.0a0.tar.gz | 3.4 kB | Without provenance | Details for yield_module_names_and_python_file_paths-0.1.0a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yield_module_names_and_python_file_paths-0.1.0a0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for yield_module_names_and_python_file_paths-0.1.0a0-py2.py3-none-any.whl |
Total release size: 7.5 kB
Release files / yield_module_names_and_python_file_paths-0.1.0a0.tar.gz
| Download URL | yield_module_names_and_python_file_paths-0.1.0a0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bc6f5dc5d1f7f93550201aa8250ba29426d3330119252921c29948fb2640387
|
|
BLAKE2b-256 checksum How to use checksums |
11506ebfd6ab252ad1fddc1df0feea8b2e97e4dd8855d688a4589168c9511813
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Release files / yield_module_names_and_python_file_paths-0.1.0a0-py2.py3-none-any.whl
| Download URL | yield_module_names_and_python_file_paths-0.1.0a0-py2.py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b3ce0fd5b325ff3649919786824fa9154fd7421141919ea5d723df72e663d889
|
|
BLAKE2b-256 checksum How to use checksums |
737f96dce82ae08bf060a1e011299a1ebdf4271ea62070977b610c25d8b795f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Security for yield-module-names-and-python-file-paths 0.1.0a0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.