Imagine…
you need all modules in a package imported
… maybe because you want to access them via inspect.getmembers
… or want to do sth. like for module in package: ...
BUT:
you are to lazy to update all your __init__.py
you dont want/can’t to use automodinit <https://github.com/ned14/automodinit>
AND/OR you cannot use dynamic imports (maybe because you want to create an application with pyinstaller)
THAN: this might be your solution!
install
via pip
pip install importStar
ubuntu or simular
sudo python setup.py install
windows
python setup.py install
usage
either: * use as a script: importstar [directorypath]
to see help: run importstar without further arguments or with -h or –help
OR call function importStar.importstar.run(args) directly
result
importstar add all modules and packages recursively within a given directory
in all __init__.py files that have the following comments:
#<<<importStar [i will be substitued] #>>>importStar
the result might look like:
#<<<importStar import mod1 import mod2 import pkg1 #>>>importStar
Metadata
Release files for importStar 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| importStar-0.1.1.zip | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| importStar-0.1.1-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 12.6 kB
Release files / importStar-0.1.1.zip
| Download URL | importStar-0.1.1.zip |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd9560d2a5920375a4dc958b95857b9e166d2c7e62acb6d6fdef67ce4b0fec61
|
|
BLAKE2b-256 checksum How to use checksums |
0739b549771aabd82896e00befa73c52a5ac1358e09c5dcc474aac6c27b6d96c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / importStar-0.1.1-py2-none-any.whl
| Download URL | importStar-0.1.1-py2-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
306e03bd94e7a7cc25f3738f5462c34deebc72fce264a3c465aef8ae2716fde4
|
|
BLAKE2b-256 checksum How to use checksums |
7673d4ced849364f52a9c434e5380a272a8cc65d9777cc859f2e5db29659a35d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |