pyprecag.config

pyprecag.config.get_config_key(key)[source]

Get an existing configuration key from the json configuration file. Currently getting a key from a nested dictionary is not supported. ie [‘geoCSV’][‘xCoordinate_ColumnName’]

Parameters:key (str) – The configuration key to extract value for

Returns: The value of the Key

pyprecag.config.get_debug_mode()[source]

Gets the value of debug_mode for the module

pyprecag.config.read_config()[source]

Reads the JSON Configuration return and returns a dictionary of values :returns: Dictionary of configuration settings. :rtype: collections.OrderedDict

pyprecag.config.set_config_key(key, new_value)[source]

Apply a value to and existing key in the configuration json file and write to file.

Currently applying a key to a nested dictionary is not supported. ie [‘geoCSV’][‘xCoordinate_ColumnName’]

Parameters:
  • key (str) – The key to apply a new value to.
  • new_value (str) – The new value for the required key
Returns:

The updated configuration dictionary

Return type:

config_dict

pyprecag.config.set_debug_mode(debug)[source]
Sets the value of debug_mode for the module constant
Args:
debug (bool): True or False value, determines if pyprecag is in debug mode
pyprecag.config.write_config(json_dict)[source]
Writes A Json Configuration Dictionary to file.
Args:
json_dict (Dict): The configuration dictionary to write to file