datawrangler.core#

datawrangler.core.get_default_options(fname=None)[source]#

Parse a config.ini file

Parameters

fname – absolute-path filename for the config.ini file (default: data-wrangler/datawrangler/core/config.ini)

Returns

A dictionary whose keys are function names and whose values are dictionaries of default arguments and keyword

arguments

datawrangler.core.apply_defaults(f, defaults=None)[source]#

Replace a function’s default arguments and keyword arguments with defaults specified in config.ini

Parameters
  • f – a function

  • defaults – an optional dictionary of default options (default: get_default_options)

Returns

a function replacing and un-specified arguments with the defaults defined in config.ini

datawrangler.core.update_dict(template, updates, from_config=False)[source]#

Replace a template dictionary’s values with new values defined in a second “updates” dictionary.

Parameters
  • template – default keys and values to use (if not specified in the “updates” dictionary)

  • updates – new values to use (and/or new keys to add to the resulting dictionary)

  • from_config – if True, evaluate the keys in the “template” dictionary and set their values to the result. Used when loading options from the configuration file. (Default: False)

Returns

A new dictionary containing the union of the keys/values in template and updates, with preference given to

the updates dictionary