Skip to main content

Load module, function from string

Project description

Load python module, or member of module from string.

Example Usage

Load module, or member of module from string.

from dynamic_load import dynamic_load
dattime_module =  dynamic_load("datetime") # Load datetime module
dattime_module.datetime.now()
time_function = dynamic_load("time.time")
time_function()

Execute functionn of module from string.

from dynamic_load import dynamic_execute
answer =  dynamic_execute("datetime.datetime.now")
answer = dynamic_execute("time.sleep", 10) # execute(time.sleep(10))

Convert function as string.

from dynamic_load immport dynamic_string
string = dynamic_string(datetime.datetime.now)

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_load-0.0.5.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file dynamic_load-0.0.5.tar.gz.

File metadata

  • Download URL: dynamic_load-0.0.5.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for dynamic_load-0.0.5.tar.gz
Algorithm Hash digest
SHA256 ba209a00edff4fcbe270b4cab3b48ac6253786ac45dd7571f0da0b61bd747a08
MD5 d8d3cb9e1e5f13ded2e376e2f372a715
BLAKE2b-256 32e6a2134b66b61b27df3eb2acde1b11126979aeee93d13d215f67176add9d01

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