Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamic-function-loader-0.0.2.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynamic_function_loader-0.0.2-py2.py3-none-any.whl (6.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dynamic-function-loader-0.0.2.tar.gz.

File metadata

  • Download URL: dynamic-function-loader-0.0.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.8.0 tqdm/4.49.0 CPython/3.7.9

File hashes

Hashes for dynamic-function-loader-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f35638bebb49d2ddd6a6a6d394d3743752b7bc14bf924d374d90097f752771b9
MD5 8cc1bb46d4baaeb97cba099ebe6542b5
BLAKE2b-256 8d978f53682505a663b7049a818b5a105e43659cbae20ecfd89d46d15ff42a70

See more details on using hashes here.

File details

Details for the file dynamic_function_loader-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: dynamic_function_loader-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.8.0 tqdm/4.49.0 CPython/3.7.9

File hashes

Hashes for dynamic_function_loader-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9bc3d550b1746d9c2f662e17ac4ac70189435a1cf72216a23ae3063cdad58685
MD5 208ec9d1c2731024e548806cb6acecf1
BLAKE2b-256 adf3c8d810b976e498ba1d318c6eb06c0fd6a8dc677ee612e2ba9b092e959b98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page