Skip to main content

Generically execute any function with a unknown set of parameters.

Project description

gexecute

A tool to generically execute any function with a unknown set of parameters!

Specify some set of parameters in a dictionary with the only restriction being that it must have all of the parameters with non-default values.

The function can either be a string representation or a function object.

If the function exists in another module; you must give either the module object or the package path and module name.

<bold>Example:</bold>

def test(a, b, c='test'):
    print(a, b, c)

> test(1, 2, 3)
1, 2, 3

> gexec({'a': 1, 'b': 2, 'c': 3}, test)
1, 2, 3

> gexec({'a': 1, 'b': 2}, test)
1, 2, test

# Function name can be an object or string
> gexec({'a': 1, 'b': 2}, 'test')
1, 2, test

> gexec({'a': 1, 'b': 2, 'd': 4}, test)
1, 2, test

# If test is in the directory C:\python\test_module.py
> gexec({'a': 1, 'b': 2, 'c': 3}, 'test', module='test_module', package_path='C:\python\')
1, 2, 3

PiPy https://pypi.org/project/generic-execute/0.0.1/

How to Install: pip install gexecute

Project details


Download files

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

Files for gexecute, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size gexecute-0.0.1-py3.7.egg (5.2 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size gexecute-0.0.1-py3-none-any.whl (7.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gexecute-0.0.1.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page