Skip to main content
Pre-release

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.

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)

Source distribution for yield-module-names-and-python-file-paths 0.1.0a0
File Size Uploaded
yield_module_names_and_python_file_paths-0.1.0a0.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yield-module-names-and-python-file-paths 0.1.0a0
File Interpreter ABI Platform
yield_module_names_and_python_file_paths-0.1.0a0-py2.py3-none-any.whl Python 2, Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.0a0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page