datawrangler.core

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

Parse a config.ini file

Parameters

param fname:

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

Returns

return:

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

param f:

a function

param defaults:

an optional dictionary of default options (default: get_default_options)

Returns

return:

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

param template:

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

param updates:

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

param 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

return:

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

the updates dictionary