Import modules from anywhere on the file system.
Project description
Introduction
Import modules from anywhere on the file system.
Usage
import path_imports
# Import a certain file
foo_module = path_imports.import_from_path('somewhere/on your/file system/foo.py')
# Import a module from a certain directory
submodule = path_imports.import_from_directory('some/directory', 'root_module.submodule')
# Find the file path of a module
path = path_imports.find_module_location('my_module', directory='my project folder')
print(path) # Output: "my project folder/my_module.py"
Installation
pip install path-imports
Documentation
There is no online documentation; however, the module has docstrings and type annotations. Your IDE should display all the relevant information to you.
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
path_imports-1.1.2.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file path_imports-1.1.2.tar.gz.
File metadata
- Download URL: path_imports-1.1.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0383a2d001664d1be00bdc25c2e98e52b5eaa9cd448f781f9c20f67e9c9eea75
|
|
| MD5 |
468118ae6ef9c471934a327c137c5f6e
|
|
| BLAKE2b-256 |
6f917fd45762f11a03a19d110212b9aa8e23ed61312b4cbfeeccc7359e3aec13
|
File details
Details for the file path_imports-1.1.2-py3-none-any.whl.
File metadata
- Download URL: path_imports-1.1.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2472f6f814d4992088950f525ab6ee4e28aedcfe2375f23a874aa077bfb7a0cc
|
|
| MD5 |
bdd533baadd2c24e6a13953325223af0
|
|
| BLAKE2b-256 |
46859e7cd66665d7c536b24f191ce5361d277f7ee06620c8200c09d6a7358cd2
|