Import Python modules from dicts and JSON formatted documents
Paker Paker is module for importing Python packages/modules from dictionaries and JSON formatted documents. It was inspired by httpimporter. Installation From PyPI pip install paker From source git clone https://github.com/desty2k/paker.git cd paker pip install . Usage In Python script You can import Python modules directly from string, dict or bytes (without disk IO). import paker import logging MODULE = {“somemodule”: {“type”: “module”, “code”: “fun = lambda x: x**2”}} logging.basicConfig(level=logging.NOTSET) if __name__ == ‘__main__’: with paker.loads(MODULE) as loader: # somemodule will […]
Read more