settings¶
Module is containing all necessary global variables for the package.
Module also has the ability to read user-defined data from two paths:
- $HOME/_SETTINGS_PATH
- /etc/_SETTINGS_PATH
See _SETTINGS_PATH for details.
Note
If the first path is found, other is ignored.
Example of the configuration file ($HOME/edeposit/harvester.json):
{
"USE_DUP_FILTER": false,
"USE_ALEPH_FILTER": false
}
Attributes¶
- harvester.settings.USE_DUP_FILTER = True¶
Use duplication filter.
- harvester.settings.USE_ALEPH_FILTER = False¶
Use Aleph filter.
- harvester.settings.ALEPH_FILTER_BY_AUTHOR = True¶
Consider records from Aleph matching only when the authors are matching?
- harvester.settings.get_all_constants()[source]¶
Get list of all uppercase, non-private globals (doesn’t start with _).
Returns: Uppercase names defined in globals() (variables from this module). Return type: list
- harvester.settings.substitute_globals(config_dict)[source]¶
Set global variables to values defined in config_dict.
Parameters: config_dict (dict) – dictionary with data, which are used to set globals. Note
config_dict have to be dictionary, or it is ignored. Also all variables, that are not already in globals, or are not types defined in _ALLOWED (str, int, float) or starts with _ are silently ignored.
- harvester.settings.DUP_FILTER_FILE = '/home/docs/.edeposit_harvester_cache.json'¶
Cache for the deduplicator.