Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Maps yaml nodes and command line arguments to python function parameters.

Project description


Maps yaml nodes and command line arguments to python function parameters.

To install: pip install configutator Or:

git clone
cd configutator
python3 install

To use:

  1. Create a main function with all the parameters you need, annotated with any defaults.
  2. Use the @ConfigMap and @ArgMap decorators to modify the default mappings if needed.
  3. In the if __name__ == "__main__": block at the bottom of the file call the loadConfig() function.

Here is an example of the most basic use:

from configutator import loadConfig
from sys import argv

def foo(param1, param2, param3=None):

if __name__ == "__main__":
  for argmap in loadConfig(argv, (foo,)):

One thing you need to keep in mind when working with configutator is that the config, command line arguments, and function parameters are all independant. The parameters given to @ConfigMap and @ArgMap are what connects them all. You should never have to change a function signature to modify the command line functionality.

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 configutator, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size configutator-1.0.2-py3-none-any.whl (14.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size configutator-1.0.2.tar.gz (11.2 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