Importastic is a project mainly written in ..., it's free.
Python import hook for pluggable architecture
Importastic ###########
Python import hook for pluggable architecture. Largely Based on Flask's extension import hook but enhanced to support real nested modules.
Currently in development, only been tested on Linux.
Lets say you have projects named foo
and foo_bar
.
Adding following code to foo/init.py will let you import foo_bar
as
foo.bar"
::
def setup():
from importastic.exthook import ExtensionImporter
importer = ExtensionImporter(['foo_%s'], __name__)
importer.install()
setup()
del setup
The separator (i.e "_") is customizable.
The author used it re-organize a large code base without running too many sed statements. Flask project uses something similar to backwardly import plugins.
./install_examples
cd examples
python ./tests.py
pip install importastic
Use at your own risk. It might kill kittens.
BSD.