Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Manage nested parameters through a json file

Project description


A Python library to match positional parameters based on a json file

When integrated properly to your script, you should be able to trigger actions like this: action object extra_parameter_1 extra_parameter_n

How does it work

You will need a Json file to define the accepted actions and objects

The Json file should look like this:

      { "object_a": {
        "help": "Description for what action1 does to object_a",
        "action": "the_name_of_your_function_for_action1_on_object_a"
        "object_b": {
        "help": "Description for what action1 does to object_b",
        "action": "the_name_of_your_function_for_action1_on_object_b"
      { "object_a": {
        "help": "Description for what action2 does to object_a",
        "action": "the_name_of_your_function_for_action2_on_object_a"
        "object_y": {
        "help": "Description for what action2 does to object_y",
        "action": "the_name_of_your_function_for_action2_on_object_y"

On your python code (e.g.: add the following:

import paramctl

params = paramctl.ParameterMap("parametermap.json")
except KeyError:
    print("No function available like " + " ".join(function[:]))

, finally, create the functions defined on the Json (under "action") like this:

def get_nodes(*argv):

...and manage the arguments as you please.

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 paramctl, version 0.56
Filename, size File type Python version Upload date Hashes
Filename, size paramctl-0.56.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page