atomiq.arguments.json module

class atomiq.arguments.json.JSONArgumentProvider(url, use_class_defaults=True)[source]

Bases: ArgumentProvider

An argument provider that grabs arguments from a JSON stored at a URL.

This can either be a local file by starting the URL with (file://...) or a web resource that serves a JSON like for example a CouchDB URL

Parameters:
  • url (str) -- URL of the CouchDB document

  • use_class_defaults (bool)

get_arguments(target_class)

Query the arguments dict from the argument provider.

Parameters:

target_class (type) -- The class of the target for which to build the arguments

Returns:

Argument dictionary in the format required by atomiq

Return type:

dict

static_arguments = {}
update_argument(name, arg_def)

Update the argument definition in the backend of the argument provider, i.e. store updated values

Parameters:
  • name (str) -- Name or identifier of the argument

  • arg_def (dict) -- dict with argument definition to be stored