Dynamically loads a function from code represented as a string.
Project description
dynamic-function-loader
Installation
pip install dynamic-function-loader
Overview
dynamic-function-loader allows dynamically loading a Python function into the current execution environment from a string
.
Usage
import dynamic_function_loader
f = dynamic_function_loader.load("def foo():\n return 'bar'")
f()
Note
All Python packages used by the imported function must be loaded within the function itself. For example:
def foo(regex):
import re
return re.compile(regex)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for dynamic-function-loader-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6acb37dfc1ec824483be664295f826068ecd33ca1ea7ac60f6b4ae6d2192250 |
|
MD5 | efd6c41115cfacfa1aac0d89dce9be70 |
|
BLAKE2b-256 | d397c068804db677f5589923cfd2c9bfb1442a2a80240cf2a566db8eca25a2df |
Close
Hashes for dynamic_function_loader-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22c21474a11f8a14446c9aa13c53655d1159fd9466e6e263d249b718fce247cb |
|
MD5 | 963371810aee88e6d6f1403f1a2551ad |
|
BLAKE2b-256 | 32f9a55b3f9773a638f96db958cf49188924de6bb76c15f7862eb8306e1cecdb |