diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-19 13:17:09 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-19 13:17:09 -0500 |
| commit | bc1280444ea3d5d4e5b5afd4e39bfb9365689393 (patch) | |
| tree | ff467903e14b9b66b4644fd86edc81d046187264 | |
| parent | Add more info on installation with poetry and zsh (diff) | |
| download | config-file-bc1280444ea3d5d4e5b5afd4e39bfb9365689393.zip | |
Add nested-lookup to project
russellballestrini is a python project
in the public domain. Rather than installing
it as a dependency, this adds it as part of
the config-file package now, which allows
more control.
21 files changed, 278 insertions, 1042 deletions
diff --git a/config_file/nested-lookup/.gitignore b/config_file/nested-lookup/.gitignore deleted file mode 100644 index c9bd7c4..0000000 --- a/config_file/nested-lookup/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -__pycache__* -.pytest_cache* -*.pyc -.coverage -build/* -dist/* -nested_lookup.egg-info/* -.cache -.vscode -git_commit.sh -venv diff --git a/config_file/nested-lookup/.travis.yml b/config_file/nested-lookup/.travis.yml deleted file mode 100644 index 5551955..0000000 --- a/config_file/nested-lookup/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: python -python: - - "2.7" - - "3.6" -# command to install dependencies -install: - - pip install . -# command to run tests -script: pytest
\ No newline at end of file diff --git a/config_file/nested-lookup/CONTRIBUTING.rst b/config_file/nested-lookup/CONTRIBUTING.rst deleted file mode 100644 index dde9f01..0000000 --- a/config_file/nested-lookup/CONTRIBUTING.rst +++ /dev/null @@ -1,7 +0,0 @@ -The ``nested-lookup`` library is public domain and open source. - -To contribute please make sure all tests pass. - -If you are adding new functionality please write a unit test. - -To avoid discussions regarding code formatting, please use `black <https://github.com/ambv/black>`_ with default settings. diff --git a/config_file/nested-lookup/nested_lookup/__init__.py b/config_file/nested-lookup/nested_lookup/__init__.py deleted file mode 100644 index 0840df6..0000000 --- a/config_file/nested-lookup/nested_lookup/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -from .nested_lookup import ( - nested_lookup, - get_all_keys, - get_occurrence_of_key, - get_occurrence_of_value, - get_occurrences_and_values -) -from .lookup_api import nested_update, nested_delete, nested_alter diff --git a/config_file/nested-lookup/nested_lookup/lookup_api.py b/config_file/nested-lookup/nested_lookup/lookup_api.py deleted file mode 100644 index a0af63a..0000000 --- a/config_file/nested-lookup/nested_lookup/lookup_api.py +++ /dev/null @@ -1,214 +0,0 @@ -import copy -import warnings -from six import iteritems -from nested_lookup import nested_lookup - - -def nested_delete(document, key, in_place=False): - if not in_place: - document = copy.deepcopy(document) - return _nested_delete(document=document, key=key) - - -def _nested_delete(document, key): - """ - Method to delete a key->value pair from a nested document - Args: - document: Might be List of Dicts (or) Dict of Lists (or) - Dict of List of Dicts etc... - key: Key to delete - Return: - Returns a document that includes everything but the given key - """ - if isinstance(document, list): - for list_items in document: - _nested_delete(document=list_items, key=key) - elif isinstance(document, dict): - if document.get(key): - del document[key] - for dict_key, dict_value in iteritems(document): - _nested_delete(document=dict_value, key=key) - return document - - -def nested_update(document, key, value, in_place=False, treat_as_element=True): - """ - Method to update a key->value pair in a nested document - Args: - document: Might be List of Dicts (or) Dict of Lists (or) - Dict of List of Dicts etc... - key: Key to update the value - value: Value to set - in_place (bool): - True: modify the dict in place; - False: create a deep copy of the dict and modify it - Defaults to False - treat_list_element (bool): - True: if a list is provided as "value", the function trys - to match the list elements to the occurences of the key. - If the key occures more often than the provided list has - elements, the first element gets recycled. - False: the provided list is treated as one scalar value and - will be set as value to every key that matches. - Defaults to True (because of backwards portability of the package). - Return: - Returns a document that has updated key, value pair. - """ - - # check if a list or scalar value is provided and create a list - # from the scalar value - # check the length of the list and provide it to _nested_update - if not treat_as_element and not isinstance(value, list): - raise Exception( - "The value must be a list when treat_as_element is False." - ) - elif treat_as_element: - value = [value] - - if not in_place: - document = copy.deepcopy(document) - return _nested_update(document=document, key=key, value=value) - - -def _nested_update(document, key, value): - """ - Method to update a key->value pair in a nested document. - If the number of passed values is less than the number of key matches - when scanning for updates, use last value as default. - Args: - document: Might be List of Dicts (or) Dict of Lists (or) - Dict of List of Dicts etc... - key (str): Key to update the value - value (list): value(s) which should be used for replacement purpouse - Return: - Returns a document that has updated key, value pair. - """ - if isinstance(document, list): - for list_items in document: - _nested_update( - document=list_items, key=key, value=value - ) - elif isinstance(document, dict): - for dict_key, dict_value in iteritems(document): - if dict_key == key: - document[key] = value[0] - if len(value) > 1: - value.pop(0) - _nested_update( - document=dict_value, key=key, value=value - ) - return document - - -def nested_alter( - document, - key, - callback_function=None, - function_parameters=None, - conversion_function=None, - wild_alter=False, - in_place=False, -): - """ - Method to alter all values of the occurences of the key "key". - The provided callback_function is used to alter the scalar values - Args: - document: Might be List of Dicts (or) Dict of Lists (or) - Dict of List of Dicts etc... - key: Key to update the value - callback_function :A callback function which alters a scalar value - HINT: You should be aware that not every element might be of - the same type, please check this in your function! - function_parameters (list): - If the callback_function has additional input arguments except - the scalar value, please specify those in this list. - conversion_function: A conversion function like str() which should be - applied to every found value before it is passed to the - "callback_function" - wild_alter: Find matching elements via wild-match by the given keys - and alter those. - HINT: Keep in mind that the wild-match might return unexpected types! - in_place (bool): - True: modify the dict in place; - False: create a deep copy of the dict and modify it - Defaults to False - Return: - Returns a document that has updated key, value pair. - """ - # check if a list or scalar value is provided and create a list from - # the scalar value - # check the length of the list and provide it to _nested_update - if isinstance(key, list): - key_len = len(key) - else: - key = [key] - key_len = len(key) - - if not in_place: - document = copy.deepcopy(document) - return _nested_alter( - document=document, - keys=key, - callback_function=callback_function, - function_parameters=function_parameters, - conversion_function=conversion_function, - wild_alter=wild_alter, - in_place=in_place, - key_len=key_len, - ) - - -def _call_callback( - value_list, callback_function, function_parameters, conversion_function -): - """ - internal helper to call the callback function - """ - return_list = [] - # loop over all values - for value in value_list: - # apply the conversion function - if conversion_function is not None: - value = conversion_function(value) - # if functions arguments are present, expand the list to variables - # via the magic operator * - if function_parameters: - trans_val = callback_function(value, *function_parameters) - else: - trans_val = callback_function(value) - # append the transformed element to the list - return_list.append(trans_val) - return return_list - - -def _nested_alter( - document, - keys, - callback_function, - function_parameters, - conversion_function, - wild_alter, - in_place, - key_len, -): - - # return data if no callback_function is provided - if callback_function is None: - warnings.warn("Please provide a callback_function to nested_alter().") - return document - - # iterate over all given keys in the list - for key in keys: - # try to find the key: - findings = nested_lookup(key, document, with_keys=True, wild=wild_alter) - for k, v in findings.items(): - trans_val = _call_callback( - v, callback_function, function_parameters, conversion_function - ) - # use the transformed value and apply the update to the key - # (dont treat the lists as elements here) - document = nested_update( - document, k, trans_val, in_place=in_place, treat_as_element=False - ) - - return document diff --git a/config_file/nested-lookup/nested_lookup/nested_lookup.py b/config_file/nested-lookup/nested_lookup/nested_lookup.py deleted file mode 100644 index 0b11b4d..0000000 --- a/config_file/nested-lookup/nested_lookup/nested_lookup.py +++ /dev/null @@ -1,182 +0,0 @@ -from six import iteritems - -from collections import defaultdict - - -values_list = [] - - -def nested_lookup(key, document, wild=False, with_keys=False): - """Lookup a key in a nested document, return a list of values""" - if with_keys: - d = defaultdict(list) - for k, v in _nested_lookup(key, document, wild=wild, with_keys=with_keys): - d[k].append(v) - return d - return list(_nested_lookup(key, document, wild=wild, with_keys=with_keys)) - - -def _is_case_insensitive_substring(a, b): - """return True if `a` is a case insensitive substring of `b`, else False""" - return str(a).lower() in str(b).lower() - - -def _nested_lookup(key, document, wild=False, with_keys=False): - """Lookup a key in a nested document, yield a value""" - if isinstance(document, list): - for d in document: - for result in _nested_lookup(key, d, wild=wild, with_keys=with_keys): - yield result - - if isinstance(document, dict): - for k, v in iteritems(document): - if key == k or (wild and _is_case_insensitive_substring(key, k)): - if with_keys: - yield k, v - else: - yield v - if isinstance(v, dict): - for result in _nested_lookup(key, v, wild=wild, with_keys=with_keys): - yield result - elif isinstance(v, list): - for d in v: - for result in _nested_lookup( - key, d, wild=wild, with_keys=with_keys - ): - yield result - - -def get_all_keys(dictionary): - """ - Method to get all keys from a nested dictionary as a List - Args: - dictionary: Nested dictionary - Returns: - List of keys in the dictionary - """ - result_list = [] - - def recrusion(document): - if isinstance(document, list): - for list_items in document: - recrusion(document=list_items) - elif isinstance(document, dict): - for key, value in iteritems(document): - result_list.append(key) - recrusion(document=value) - return - - recrusion(document=dictionary) - return result_list - - -def get_occurrence_of_key(dictionary, key): - """ - Method to get occurrence of a key in a nested dictionary - - Args: - dictionary: Nested dictionary - key: Key to search for the occurrences - Return: - Number of occurrence (Integer) - """ - return _get_occurrence(dictionary=dictionary, item="key", keyword=key) - - -def get_occurrences_and_values(items, value): - """ - Method to get occurrence of a value in a nested list of dictionary - - Args: - items: list of dictionary: Nested dictionary - value: Value to search for the occurrences - - Return: - Dict where the key is the value arg and his value is a new - dict with occurrences and values - """ - occurrences = {} - occurrence = 0 - value_list = [] - - for item in items: - occurrence_result, values = _get_occurrence_with_values(dictionary=item, item="value", keyword=value) - occurrence = occurrence + occurrence_result - if occurrence_result: - value_list.extend(values) - - occurrences[value] = { - 'occurrences': occurrence, - 'values': value_list - } - - return occurrences - - -def _get_occurrence_with_values(dictionary, item, keyword): - occurrence = [0] - - result_recursion = _recursion(dictionary, item, keyword, occurrence, True) - - global values_list - values_list = [] - - return occurrence[0], result_recursion - - -def get_occurrence_of_value(dictionary, value): - """ - Method to get occurrence of a value in a nested dictionary - - Args: - dictionary: Nested dictionary - value: Value to search for the occurrences - Return: - Number of occurrence (Integer) - """ - return _get_occurrence(dictionary=dictionary, item="value", keyword=value) - - -def _recursion(dictionary, item, keyword, occurrence, with_values=False): - - global values_list - - if item == "key": - if dictionary.get(keyword) is not None: - occurrence[0] += 1 - elif keyword in list(dictionary.values()): - occurrence[0] += list(dictionary.values()).count(keyword) - if with_values: - values_list.append(dictionary) - for key, value in iteritems(dictionary): - if isinstance(value, dict): - _recursion(value, item, keyword, occurrence, with_values) - elif isinstance(value, list): - for list_items in value: - if hasattr(list_items, "items"): - _recursion(list_items, item, keyword, occurrence, with_values) - elif list_items == keyword: - occurrence[0] += 1 if item == "value" else 0 - - if values_list: - return values_list - - -def _get_occurrence(dictionary, item, keyword): - """ - Method to get occurrence of a key or value in a nested dictionary - - Args: - dictionary: Nested dictionary - item: Mostly (key or value) - keyword: key word to find occurrence - Return: - Number of occurrence of the given keyword in the dict - """ - occurrence = [0] - _recursion(dictionary, item, keyword, occurrence) - - global values_list - values_list = [] - - return occurrence[0] diff --git a/config_file/nested_lookup/.gitignore b/config_file/nested_lookup/.gitignore deleted file mode 100644 index c9bd7c4..0000000 --- a/config_file/nested_lookup/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -__pycache__* -.pytest_cache* -*.pyc -.coverage -build/* -dist/* -nested_lookup.egg-info/* -.cache -.vscode -git_commit.sh -venv diff --git a/config_file/nested_lookup/.travis.yml b/config_file/nested_lookup/.travis.yml deleted file mode 100644 index 5551955..0000000 --- a/config_file/nested_lookup/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: python -python: - - "2.7" - - "3.6" -# command to install dependencies -install: - - pip install . -# command to run tests -script: pytest
\ No newline at end of file diff --git a/config_file/nested_lookup/CONTRIBUTING.rst b/config_file/nested_lookup/CONTRIBUTING.rst deleted file mode 100644 index dde9f01..0000000 --- a/config_file/nested_lookup/CONTRIBUTING.rst +++ /dev/null @@ -1,7 +0,0 @@ -The ``nested-lookup`` library is public domain and open source. - -To contribute please make sure all tests pass. - -If you are adding new functionality please write a unit test. - -To avoid discussions regarding code formatting, please use `black <https://github.com/ambv/black>`_ with default settings. diff --git a/config_file/nested_lookup/__init__.py b/config_file/nested_lookup/__init__.py index 0840df6..768facc 100644 --- a/config_file/nested_lookup/__init__.py +++ b/config_file/nested_lookup/__init__.py @@ -5,4 +5,8 @@ from .nested_lookup import ( get_occurrence_of_value, get_occurrences_and_values ) -from .lookup_api import nested_update, nested_delete, nested_alter +from .lookup_api import ( + nested_update, + nested_delete, + nested_alter +) diff --git a/config_file/nested_lookup/lookup_api.py b/config_file/nested_lookup/lookup_api.py index a0af63a..e103534 100644 --- a/config_file/nested_lookup/lookup_api.py +++ b/config_file/nested_lookup/lookup_api.py @@ -1,7 +1,7 @@ import copy import warnings -from six import iteritems -from nested_lookup import nested_lookup + +from .nested_lookup import nested_lookup def nested_delete(document, key, in_place=False): @@ -26,7 +26,7 @@ def _nested_delete(document, key): elif isinstance(document, dict): if document.get(key): del document[key] - for dict_key, dict_value in iteritems(document): + for dict_key, dict_value in document.items(): _nested_delete(document=dict_value, key=key) return document @@ -34,16 +34,21 @@ def _nested_delete(document, key): def nested_update(document, key, value, in_place=False, treat_as_element=True): """ Method to update a key->value pair in a nested document + Args: document: Might be List of Dicts (or) Dict of Lists (or) Dict of List of Dicts etc... + key: Key to update the value + value: Value to set + in_place (bool): True: modify the dict in place; False: create a deep copy of the dict and modify it Defaults to False - treat_list_element (bool): + + treat_as_element (bool): True: if a list is provided as "value", the function trys to match the list elements to the occurences of the key. If the key occures more often than the provided list has @@ -51,6 +56,7 @@ def nested_update(document, key, value, in_place=False, treat_as_element=True): False: the provided list is treated as one scalar value and will be set as value to every key that matches. Defaults to True (because of backwards portability of the package). + Return: Returns a document that has updated key, value pair. """ @@ -89,7 +95,7 @@ def _nested_update(document, key, value): document=list_items, key=key, value=value ) elif isinstance(document, dict): - for dict_key, dict_value in iteritems(document): + for dict_key, dict_value in document.items(): if dict_key == key: document[key] = value[0] if len(value) > 1: diff --git a/config_file/nested_lookup/nested_lookup.py b/config_file/nested_lookup/nested_lookup.py index 0b11b4d..9454a44 100644 --- a/config_file/nested_lookup/nested_lookup.py +++ b/config_file/nested_lookup/nested_lookup.py @@ -1,5 +1,3 @@ -from six import iteritems - from collections import defaultdict @@ -29,7 +27,7 @@ def _nested_lookup(key, document, wild=False, with_keys=False): yield result if isinstance(document, dict): - for k, v in iteritems(document): + for k, v in document.items(): if key == k or (wild and _is_case_insensitive_substring(key, k)): if with_keys: yield k, v @@ -61,7 +59,7 @@ def get_all_keys(dictionary): for list_items in document: recrusion(document=list_items) elif isinstance(document, dict): - for key, value in iteritems(document): + for key, value in document.items(): result_list.append(key) recrusion(document=value) return @@ -148,7 +146,7 @@ def _recursion(dictionary, item, keyword, occurrence, with_values=False): occurrence[0] += list(dictionary.values()).count(keyword) if with_values: values_list.append(dictionary) - for key, value in iteritems(dictionary): + for key, value in dictionary.items(): if isinstance(value, dict): _recursion(value, item, keyword, occurrence, with_values) elif isinstance(value, list): diff --git a/config_file/nested_lookup/nested_lookup/__init__.py b/config_file/nested_lookup/nested_lookup/__init__.py deleted file mode 100644 index 0840df6..0000000 --- a/config_file/nested_lookup/nested_lookup/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -from .nested_lookup import ( - nested_lookup, - get_all_keys, - get_occurrence_of_key, - get_occurrence_of_value, - get_occurrences_and_values -) -from .lookup_api import nested_update, nested_delete, nested_alter diff --git a/config_file/nested_lookup/nested_lookup/lookup_api.py b/config_file/nested_lookup/nested_lookup/lookup_api.py deleted file mode 100644 index a0af63a..0000000 --- a/config_file/nested_lookup/nested_lookup/lookup_api.py +++ /dev/null @@ -1,214 +0,0 @@ -import copy -import warnings -from six import iteritems -from nested_lookup import nested_lookup - - -def nested_delete(document, key, in_place=False): - if not in_place: - document = copy.deepcopy(document) - return _nested_delete(document=document, key=key) - - -def _nested_delete(document, key): - """ - Method to delete a key->value pair from a nested document - Args: - document: Might be List of Dicts (or) Dict of Lists (or) - Dict of List of Dicts etc... - key: Key to delete - Return: - Returns a document that includes everything but the given key - """ - if isinstance(document, list): - for list_items in document: - _nested_delete(document=list_items, key=key) - elif isinstance(document, dict): - if document.get(key): - del document[key] - for dict_key, dict_value in iteritems(document): - _nested_delete(document=dict_value, key=key) - return document - - -def nested_update(document, key, value, in_place=False, treat_as_element=True): - """ - Method to update a key->value pair in a nested document - Args: - document: Might be List of Dicts (or) Dict of Lists (or) - Dict of List of Dicts etc... - key: Key to update the value - value: Value to set - in_place (bool): - True: modify the dict in place; - False: create a deep copy of the dict and modify it - Defaults to False - treat_list_element (bool): - True: if a list is provided as "value", the function trys - to match the list elements to the occurences of the key. - If the key occures more often than the provided list has - elements, the first element gets recycled. - False: the provided list is treated as one scalar value and - will be set as value to every key that matches. - Defaults to True (because of backwards portability of the package). - Return: - Returns a document that has updated key, value pair. - """ - - # check if a list or scalar value is provided and create a list - # from the scalar value - # check the length of the list and provide it to _nested_update - if not treat_as_element and not isinstance(value, list): - raise Exception( - "The value must be a list when treat_as_element is False." - ) - elif treat_as_element: - value = [value] - - if not in_place: - document = copy.deepcopy(document) - return _nested_update(document=document, key=key, value=value) - - -def _nested_update(document, key, value): - """ - Method to update a key->value pair in a nested document. - If the number of passed values is less than the number of key matches - when scanning for updates, use last value as default. - Args: - document: Might be List of Dicts (or) Dict of Lists (or) - Dict of List of Dicts etc... - key (str): Key to update the value - value (list): value(s) which should be used for replacement purpouse - Return: - Returns a document that has updated key, value pair. - """ - if isinstance(document, list): - for list_items in document: - _nested_update( - document=list_items, key=key, value=value - ) - elif isinstance(document, dict): - for dict_key, dict_value in iteritems(document): - if dict_key == key: - document[key] = value[0] - if len(value) > 1: - value.pop(0) - _nested_update( - document=dict_value, key=key, value=value - ) - return document - - -def nested_alter( - document, - key, - callback_function=None, - function_parameters=None, - conversion_function=None, - wild_alter=False, - in_place=False, -): - """ - Method to alter all values of the occurences of the key "key". - The provided callback_function is used to alter the scalar values - Args: - document: Might be List of Dicts (or) Dict of Lists (or) - Dict of List of Dicts etc... - key: Key to update the value - callback_function :A callback function which alters a scalar value - HINT: You should be aware that not every element might be of - the same type, please check this in your function! - function_parameters (list): - If the callback_function has additional input arguments except - the scalar value, please specify those in this list. - conversion_function: A conversion function like str() which should be - applied to every found value before it is passed to the - "callback_function" - wild_alter: Find matching elements via wild-match by the given keys - and alter those. - HINT: Keep in mind that the wild-match might return unexpected types! - in_place (bool): - True: modify the dict in place; - False: create a deep copy of the dict and modify it - Defaults to False - Return: - Returns a document that has updated key, value pair. - """ - # check if a list or scalar value is provided and create a list from - # the scalar value - # check the length of the list and provide it to _nested_update - if isinstance(key, list): - key_len = len(key) - else: - key = [key] - key_len = len(key) - - if not in_place: - document = copy.deepcopy(document) - return _nested_alter( - document=document, - keys=key, - callback_function=callback_function, - function_parameters=function_parameters, - conversion_function=conversion_function, - wild_alter=wild_alter, - in_place=in_place, - key_len=key_len, - ) - - -def _call_callback( - value_list, callback_function, function_parameters, conversion_function -): - """ - internal helper to call the callback function - """ - return_list = [] - # loop over all values - for value in value_list: - # apply the conversion function - if conversion_function is not None: - value = conversion_function(value) - # if functions arguments are present, expand the list to variables - # via the magic operator * - if function_parameters: - trans_val = callback_function(value, *function_parameters) - else: - trans_val = callback_function(value) - # append the transformed element to the list - return_list.append(trans_val) - return return_list - - -def _nested_alter( - document, - keys, - callback_function, - function_parameters, - conversion_function, - wild_alter, - in_place, - key_len, -): - - # return data if no callback_function is provided - if callback_function is None: - warnings.warn("Please provide a callback_function to nested_alter().") - return document - - # iterate over all given keys in the list - for key in keys: - # try to find the key: - findings = nested_lookup(key, document, with_keys=True, wild=wild_alter) - for k, v in findings.items(): - trans_val = _call_callback( - v, callback_function, function_parameters, conversion_function - ) - # use the transformed value and apply the update to the key - # (dont treat the lists as elements here) - document = nested_update( - document, k, trans_val, in_place=in_place, treat_as_element=False - ) - - return document diff --git a/config_file/nested_lookup/nested_lookup/nested_lookup.py b/config_file/nested_lookup/nested_lookup/nested_lookup.py deleted file mode 100644 index 0b11b4d..0000000 --- a/config_file/nested_lookup/nested_lookup/nested_lookup.py +++ /dev/null @@ -1,182 +0,0 @@ -from six import iteritems - -from collections import defaultdict - - -values_list = [] - - -def nested_lookup(key, document, wild=False, with_keys=False): - """Lookup a key in a nested document, return a list of values""" - if with_keys: - d = defaultdict(list) - for k, v in _nested_lookup(key, document, wild=wild, with_keys=with_keys): - d[k].append(v) - return d - return list(_nested_lookup(key, document, wild=wild, with_keys=with_keys)) - - -def _is_case_insensitive_substring(a, b): - """return True if `a` is a case insensitive substring of `b`, else False""" - return str(a).lower() in str(b).lower() - - -def _nested_lookup(key, document, wild=False, with_keys=False): - """Lookup a key in a nested document, yield a value""" - if isinstance(document, list): - for d in document: - for result in _nested_lookup(key, d, wild=wild, with_keys=with_keys): - yield result - - if isinstance(document, dict): - for k, v in iteritems(document): - if key == k or (wild and _is_case_insensitive_substring(key, k)): - if with_keys: - yield k, v - else: - yield v - if isinstance(v, dict): - for result in _nested_lookup(key, v, wild=wild, with_keys=with_keys): - yield result - elif isinstance(v, list): - for d in v: - for result in _nested_lookup( - key, d, wild=wild, with_keys=with_keys - ): - yield result - - -def get_all_keys(dictionary): - """ - Method to get all keys from a nested dictionary as a List - Args: - dictionary: Nested dictionary - Returns: - List of keys in the dictionary - """ - result_list = [] - - def recrusion(document): - if isinstance(document, list): - for list_items in document: - recrusion(document=list_items) - elif isinstance(document, dict): - for key, value in iteritems(document): - result_list.append(key) - recrusion(document=value) - return - - recrusion(document=dictionary) - return result_list - - -def get_occurrence_of_key(dictionary, key): - """ - Method to get occurrence of a key in a nested dictionary - - Args: - dictionary: Nested dictionary - key: Key to search for the occurrences - Return: - Number of occurrence (Integer) - """ - return _get_occurrence(dictionary=dictionary, item="key", keyword=key) - - -def get_occurrences_and_values(items, value): - """ - Method to get occurrence of a value in a nested list of dictionary - - Args: - items: list of dictionary: Nested dictionary - value: Value to search for the occurrences - - Return: - Dict where the key is the value arg and his value is a new - dict with occurrences and values - """ - occurrences = {} - occurrence = 0 - value_list = [] - - for item in items: - occurrence_result, values = _get_occurrence_with_values(dictionary=item, item="value", keyword=value) - occurrence = occurrence + occurrence_result - if occurrence_result: - value_list.extend(values) - - occurrences[value] = { - 'occurrences': occurrence, - 'values': value_list - } - - return occurrences - - -def _get_occurrence_with_values(dictionary, item, keyword): - occurrence = [0] - - result_recursion = _recursion(dictionary, item, keyword, occurrence, True) - - global values_list - values_list = [] - - return occurrence[0], result_recursion - - -def get_occurrence_of_value(dictionary, value): - """ - Method to get occurrence of a value in a nested dictionary - - Args: - dictionary: Nested dictionary - value: Value to search for the occurrences - Return: - Number of occurrence (Integer) - """ - return _get_occurrence(dictionary=dictionary, item="value", keyword=value) - - -def _recursion(dictionary, item, keyword, occurrence, with_values=False): - - global values_list - - if item == "key": - if dictionary.get(keyword) is not None: - occurrence[0] += 1 - elif keyword in list(dictionary.values()): - occurrence[0] += list(dictionary.values()).count(keyword) - if with_values: - values_list.append(dictionary) - for key, value in iteritems(dictionary): - if isinstance(value, dict): - _recursion(value, item, keyword, occurrence, with_values) - elif isinstance(value, list): - for list_items in value: - if hasattr(list_items, "items"): - _recursion(list_items, item, keyword, occurrence, with_values) - elif list_items == keyword: - occurrence[0] += 1 if item == "value" else 0 - - if values_list: - return values_list - - -def _get_occurrence(dictionary, item, keyword): - """ - Method to get occurrence of a key or value in a nested dictionary - - Args: - dictionary: Nested dictionary - item: Mostly (key or value) - keyword: key word to find occurrence - Return: - Number of occurrence of the given keyword in the dict - """ - occurrence = [0] - _recursion(dictionary, item, keyword, occurrence) - - global values_list - values_list = [] - - return occurrence[0] diff --git a/config_file/parsers/json_parser.py b/config_file/parsers/json_parser.py index 584a2d0..13b84b5 100644 --- a/config_file/parsers/json_parser.py +++ b/config_file/parsers/json_parser.py @@ -1,6 +1,6 @@ import json -from nested_lookup import ( +from config_file.nested_lookup import ( get_occurrence_of_key, nested_delete, nested_lookup, @@ -8,8 +8,7 @@ from nested_lookup import ( ) from config_file.exceptions import ParsingError -from config_file.parsers.base_parser import BaseParser -from config_file.parsers.parse_value import parse_value +from config_file.parsers import BaseParser, parse_value from config_file.utils import split_on_dot @@ -70,15 +69,14 @@ class JsonParser(BaseParser): split_keys = split_on_dot(key) result = self.parsed_content - # Used so we can more precisely specify what key is causing the error. - key_for_error = None + key_causing_error = None try: for key in split_keys: - key_for_error = key + key_causing_error = key result = result[key] except TypeError: raise ParsingError( - f"Cannot get {key} because {key_for_error} is not subscriptable." + f"Cannot get {key} because {key_causing_error} is not subscriptable." ) else: result = self.parsed_content[key] diff --git a/config_file/parsers/toml_parser.py b/config_file/parsers/toml_parser.py index 64ab216..ad3e7f4 100644 --- a/config_file/parsers/toml_parser.py +++ b/config_file/parsers/toml_parser.py @@ -1,6 +1,105 @@ -from config_file.parsers import BaseParser - import toml +from config_file.nested_lookup import ( + get_occurrence_of_key, + nested_delete, + nested_lookup, + nested_update, +) +from config_file.exceptions import ParsingError +from config_file.parsers import BaseParser, parse_value +from config_file.utils import split_on_dot + + class TomlParser(BaseParser): - pass
\ No newline at end of file + """The TomlParser allows use of toml files with ConfigFile.""" + + def __init__(self, file_contents: str): + """Reads in the file contents into the parser.""" + super().__init__(file_contents) + + def parse(self, file_contents: str): + try: + return toml.loads(file_contents) + except toml.TomlDecodeError as error: + raise ParsingError(error) + + def get(self, key: str, parse_types: bool = False, all: bool = False): + """ + Retrieve values using a dot syntax. + + :param key: The key to retrieve. e.g. 'foo.bar.boo' + + :param parse_types: Whether you'd like the type parsed into its native one. + + :param all: Specify whether you'd like to recursively receive + all values that match the given key. Returned as a list. + e.g. 'foo' would retrieve all values that have the key 'foo', anywhere + in the json. + + :return: the value of the given key + """ + if all: + result = nested_lookup(key, self.parsed_content) + elif "." in key: + split_keys = split_on_dot(key) + result = self.parsed_content + + # Used so we can more precisely specify what key is causing the error. + key_for_error = None + try: + for key in split_keys: + key_for_error = key + result = result[key] + except TypeError: + raise ParsingError( + f"Cannot get {key} because {key_for_error} is not subscriptable." + ) + else: + result = self.parsed_content[key] + + return parse_value(result) if parse_types else result + + def set(self, key: str, value, all: bool = False): + if all: + nested_update(self.parsed_content, key, value, in_place=True) + elif "." in key: + indexes = split_on_dot(key) + indexes_length = len(indexes) + + ref = self.parsed_content + for index, key in enumerate(indexes): + if index == indexes_length - 1: + ref[key] = value + break + + ref = ref[key] + else: + self.parsed_content[key] = value + + return True + + def delete(self, key, all: bool = False): + if all: + nested_delete(self.parsed_content, key, in_place=True) + elif "." in key: + indexes = split_on_dot(key) + indexes_length = len(indexes) + + ref = self.parsed_content + for index, key in enumerate(indexes): + if index == indexes_length - 1: + del ref[key] + break + + ref = ref[key] + else: + del self.parsed_content[key] + + return True + + def stringify(self) -> str: + return json.dumps(self.parsed_content, indent=4) + + def has(self, search_key: str) -> bool: + return get_occurrence_of_key(self.parsed_content, key=search_key) > 0 diff --git a/poetry.lock b/poetry.lock index 566d146..afe6577 100644 --- a/poetry.lock +++ b/poetry.lock @@ -9,7 +9,6 @@ version = "0.7.12" [[package]] category = "dev" description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "appdirs" optional = false python-versions = "*" @@ -86,7 +85,6 @@ pytz = ">=2015.7" [[package]] category = "dev" description = "The uncompromising code formatter." -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "black" optional = false python-versions = ">=3.6" @@ -127,18 +125,15 @@ description = "Python package for providing Mozilla's CA Bundle." name = "certifi" optional = false python-versions = "*" -version = "2020.4.5.2" +version = "2020.6.20" [[package]] category = "dev" description = "Validate configuration and produce human readable error messages." name = "cfgv" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "2.0.1" - -[package.dependencies] -six = "*" +python-versions = ">=3.6" +version = "3.0.0" [[package]] category = "dev" @@ -151,7 +146,6 @@ version = "3.0.4" [[package]] category = "dev" description = "Composable command line interface toolkit" -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "click" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" @@ -172,13 +166,21 @@ description = "Code coverage measurement for Python" name = "coverage" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" -version = "5.1" +version = "5.2" [package.extras] toml = ["toml"] [[package]] category = "dev" +description = "Distribution utilities" +name = "distlib" +optional = false +python-versions = "*" +version = "0.3.1" + +[[package]] +category = "dev" description = "Docutils -- Python Documentation Utilities" name = "docutils" optional = false @@ -187,6 +189,14 @@ version = "0.16" [[package]] category = "dev" +description = "A platform independent file lock." +name = "filelock" +optional = false +python-versions = "*" +version = "3.0.12" + +[[package]] +category = "dev" description = "the modular source code checker: pep8 pyflakes and co" name = "flake8" optional = false @@ -208,7 +218,7 @@ description = "File identification library for Python" name = "identify" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" -version = "1.4.19" +version = "1.4.23" [package.extras] license = ["editdistance"] @@ -219,7 +229,7 @@ description = "Internationalized Domain Names in Applications (IDNA)" name = "idna" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "2.9" +version = "2.10" [[package]] category = "dev" @@ -236,7 +246,7 @@ marker = "python_version < \"3.8\"" name = "importlib-metadata" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -version = "1.6.1" +version = "1.7.0" [package.dependencies] zipp = ">=0.5" @@ -252,13 +262,9 @@ marker = "python_version < \"3.7\"" name = "importlib-resources" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -version = "2.0.0" +version = "3.0.0" [package.dependencies] -[package.dependencies.importlib-metadata] -python = "<3.8" -version = "*" - [package.dependencies.zipp] python = "<3.8" version = ">=0.4" @@ -316,18 +322,7 @@ description = "More routines for operating on iterables, beyond itertools" name = "more-itertools" optional = false python-versions = ">=3.5" -version = "8.3.0" - -[[package]] -category = "main" -description = "Python functions for working with deeply nested documents (lists and dicts)" -name = "nested-lookup" -optional = false -python-versions = "*" -version = "0.2.21" - -[package.dependencies] -six = "*" +version = "8.4.0" [[package]] category = "dev" @@ -351,20 +346,7 @@ six = "*" [[package]] category = "dev" -description = "Object-oriented filesystem paths" -marker = "python_version < \"3.6\"" -name = "pathlib2" -optional = false -python-versions = "*" -version = "2.3.5" - -[package.dependencies] -six = "*" - -[[package]] -category = "dev" description = "Utility library for gitignore style pattern matching of file paths." -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "pathspec" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" @@ -418,7 +400,7 @@ description = "library with cross-python path, ini-parsing, io, code, log facili name = "py" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.8.1" +version = "1.9.0" [[package]] category = "dev" @@ -474,10 +456,6 @@ wcwidth = "*" python = "<3.8" version = ">=0.12" -[package.dependencies.pathlib2] -python = "<3.6" -version = ">=2.2.0" - [package.extras] checkqa-mypy = ["mypy (v0.761)"] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] @@ -488,11 +466,11 @@ description = "Pytest plugin for measuring coverage." name = "pytest-cov" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "2.9.0" +version = "2.10.0" [package.dependencies] coverage = ">=4.4" -pytest = ">=3.6" +pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests (2.0.2)", "six", "pytest-xdist", "virtualenv"] @@ -503,7 +481,7 @@ description = "pytest-sugar is a plugin for pytest that changes the default look name = "pytest-sugar" optional = false python-versions = "*" -version = "0.9.3" +version = "0.9.4" [package.dependencies] packaging = ">=14.1" @@ -529,11 +507,10 @@ version = "5.3.1" [[package]] category = "dev" description = "Alternative regular expression module, to replace re." -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "regex" optional = false python-versions = "*" -version = "2020.6.8" +version = "2020.7.14" [[package]] category = "dev" @@ -541,7 +518,7 @@ description = "Python HTTP for Humans." name = "requests" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "2.23.0" +version = "2.24.0" [package.dependencies] certifi = ">=2017.4.17" @@ -566,7 +543,7 @@ version = "2.2.0" "aspy.refactor-imports" = "*" [[package]] -category = "main" +category = "dev" description = "Python 2 and 3 compatibility utilities" name = "six" optional = false @@ -697,7 +674,6 @@ test = ["pytest"] [[package]] category = "dev" description = "tasks runner for python projects" -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "taskipy" optional = false python-versions = ">=3.6,<4.0" @@ -725,7 +701,6 @@ version = "0.10.1" [[package]] category = "dev" description = "a fork of Python 2 and 3 ast modules with type comment support" -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "typed-ast" optional = false python-versions = "*" @@ -750,11 +725,25 @@ description = "Virtual Python Environment builder" name = "virtualenv" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" -version = "16.7.10" +version = "20.0.27" + +[package.dependencies] +appdirs = ">=1.4.3,<2" +distlib = ">=0.3.1,<1" +filelock = ">=3.0.0,<4" +six = ">=1.9.0,<2" + +[package.dependencies.importlib-metadata] +python = "<3.8" +version = ">=0.12,<2" + +[package.dependencies.importlib-resources] +python = "<3.7" +version = ">=1.0" [package.extras] -docs = ["sphinx (>=1.8.0,<2)", "towncrier (>=18.5.0)", "sphinx-rtd-theme (>=0.4.2,<1)"] -testing = ["pytest (>=4.0.0,<5)", "coverage (>=4.5.0,<5)", "pytest-timeout (>=1.3.0,<2)", "six (>=1.10.0,<2)", "pytest-xdist", "pytest-localserver", "pypiserver", "mock", "xonsh"] +docs = ["sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=19.9.0rc1)", "proselint (>=0.10.2)"] +testing = ["pytest (>=4)", "coverage (>=5)", "coverage-enable-subprocess (>=1)", "pytest-xdist (>=1.31.0)", "pytest-mock (>=2)", "pytest-env (>=0.6.2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "pytest-freezegun (>=0.4.1)", "flaky (>=3)", "packaging (>=20.0)", "xonsh (>=0.9.16)"] [[package]] category = "dev" @@ -762,7 +751,7 @@ description = "Measures the displayed width of unicode strings in a terminal" name = "wcwidth" optional = false python-versions = "*" -version = "0.2.4" +version = "0.2.5" [[package]] category = "dev" @@ -770,20 +759,20 @@ description = "Backport of pathlib-compatible object wrapper for zip files" marker = "python_version < \"3.8\"" name = "zipp" optional = false -python-versions = ">=2.7" -version = "1.2.0" +python-versions = ">=3.6" +version = "3.1.0" [package.extras] docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] -testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"] +testing = ["jaraco.itertools", "func-timeout"] [extras] toml = ["toml"] yaml = ["pyyaml"] [metadata] -content-hash = "cbcbacf7c64fd8aec4372a6979e3ef11a81c049e7baf24b1b396023209b960cd" -python-versions = "^3.5" +content-hash = "432d63eaf6fb166650820be893bb3364a954b8fcf81b618bbfb398dbb54de1f6" +python-versions = "^3.6" [metadata.files] alabaster = [ @@ -830,12 +819,12 @@ cached-property = [ {file = "cached_property-1.5.1-py2.py3-none-any.whl", hash = "sha256:3a026f1a54135677e7da5ce819b0c690f156f37976f3e30c5430740725203d7f"}, ] certifi = [ - {file = "certifi-2020.4.5.2-py2.py3-none-any.whl", hash = "sha256:9cd41137dc19af6a5e03b630eefe7d1f458d964d406342dd3edf625839b944cc"}, - {file = "certifi-2020.4.5.2.tar.gz", hash = "sha256:5ad7e9a056d25ffa5082862e36f119f7f7cec6457fa07ee2f8c339814b80c9b1"}, + {file = "certifi-2020.6.20-py2.py3-none-any.whl", hash = "sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41"}, + {file = "certifi-2020.6.20.tar.gz", hash = "sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3"}, ] cfgv = [ - {file = "cfgv-2.0.1-py2.py3-none-any.whl", hash = "sha256:fbd93c9ab0a523bf7daec408f3be2ed99a980e20b2d19b50fc184ca6b820d289"}, - {file = "cfgv-2.0.1.tar.gz", hash = "sha256:edb387943b665bf9c434f717bf630fa78aecd53d5900d2e05da6ad6048553144"}, + {file = "cfgv-3.0.0-py2.py3-none-any.whl", hash = "sha256:f22b426ed59cd2ab2b54ff96608d846c33dfb8766a67f0b4a6ce130ce244414f"}, + {file = "cfgv-3.0.0.tar.gz", hash = "sha256:04b093b14ddf9fd4d17c53ebfd55582d27b76ed30050193c14e560770c5360eb"}, ] chardet = [ {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, @@ -850,65 +839,76 @@ colorama = [ {file = "colorama-0.4.3.tar.gz", hash = "sha256:e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"}, ] coverage = [ - {file = "coverage-5.1-cp27-cp27m-macosx_10_12_x86_64.whl", hash = "sha256:0cb4be7e784dcdc050fc58ef05b71aa8e89b7e6636b99967fadbdba694cf2b65"}, - {file = "coverage-5.1-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:c317eaf5ff46a34305b202e73404f55f7389ef834b8dbf4da09b9b9b37f76dd2"}, - {file = "coverage-5.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:b83835506dfc185a319031cf853fa4bb1b3974b1f913f5bb1a0f3d98bdcded04"}, - {file = "coverage-5.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5f2294dbf7875b991c381e3d5af2bcc3494d836affa52b809c91697449d0eda6"}, - {file = "coverage-5.1-cp27-cp27m-win32.whl", hash = "sha256:de807ae933cfb7f0c7d9d981a053772452217df2bf38e7e6267c9cbf9545a796"}, - {file = "coverage-5.1-cp27-cp27m-win_amd64.whl", hash = "sha256:bf9cb9a9fd8891e7efd2d44deb24b86d647394b9705b744ff6f8261e6f29a730"}, - {file = "coverage-5.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:acf3763ed01af8410fc36afea23707d4ea58ba7e86a8ee915dfb9ceff9ef69d0"}, - {file = "coverage-5.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:dec5202bfe6f672d4511086e125db035a52b00f1648d6407cc8e526912c0353a"}, - {file = "coverage-5.1-cp35-cp35m-macosx_10_12_x86_64.whl", hash = "sha256:7a5bdad4edec57b5fb8dae7d3ee58622d626fd3a0be0dfceda162a7035885ecf"}, - {file = "coverage-5.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:1601e480b9b99697a570cea7ef749e88123c04b92d84cedaa01e117436b4a0a9"}, - {file = "coverage-5.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:dbe8c6ae7534b5b024296464f387d57c13caa942f6d8e6e0346f27e509f0f768"}, - {file = "coverage-5.1-cp35-cp35m-win32.whl", hash = "sha256:a027ef0492ede1e03a8054e3c37b8def89a1e3c471482e9f046906ba4f2aafd2"}, - {file = "coverage-5.1-cp35-cp35m-win_amd64.whl", hash = "sha256:0e61d9803d5851849c24f78227939c701ced6704f337cad0a91e0972c51c1ee7"}, - {file = "coverage-5.1-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:2d27a3f742c98e5c6b461ee6ef7287400a1956c11421eb574d843d9ec1f772f0"}, - {file = "coverage-5.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:66460ab1599d3cf894bb6baee8c684788819b71a5dc1e8fa2ecc152e5d752019"}, - {file = "coverage-5.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:5c542d1e62eece33c306d66fe0a5c4f7f7b3c08fecc46ead86d7916684b36d6c"}, - {file = "coverage-5.1-cp36-cp36m-win32.whl", hash = "sha256:2742c7515b9eb368718cd091bad1a1b44135cc72468c731302b3d641895b83d1"}, - {file = "coverage-5.1-cp36-cp36m-win_amd64.whl", hash = "sha256:dead2ddede4c7ba6cb3a721870f5141c97dc7d85a079edb4bd8d88c3ad5b20c7"}, - {file = "coverage-5.1-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:01333e1bd22c59713ba8a79f088b3955946e293114479bbfc2e37d522be03355"}, - {file = "coverage-5.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:e1ea316102ea1e1770724db01998d1603ed921c54a86a2efcb03428d5417e489"}, - {file = "coverage-5.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:adeb4c5b608574a3d647011af36f7586811a2c1197c861aedb548dd2453b41cd"}, - {file = "coverage-5.1-cp37-cp37m-win32.whl", hash = "sha256:782caea581a6e9ff75eccda79287daefd1d2631cc09d642b6ee2d6da21fc0a4e"}, - {file = "coverage-5.1-cp37-cp37m-win_amd64.whl", hash = "sha256:00f1d23f4336efc3b311ed0d807feb45098fc86dee1ca13b3d6768cdab187c8a"}, - {file = "coverage-5.1-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:402e1744733df483b93abbf209283898e9f0d67470707e3c7516d84f48524f55"}, - {file = "coverage-5.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:a3f3654d5734a3ece152636aad89f58afc9213c6520062db3978239db122f03c"}, - {file = "coverage-5.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:6402bd2fdedabbdb63a316308142597534ea8e1895f4e7d8bf7476c5e8751fef"}, - {file = "coverage-5.1-cp38-cp38-win32.whl", hash = "sha256:8fa0cbc7ecad630e5b0f4f35b0f6ad419246b02bc750de7ac66db92667996d24"}, - {file = "coverage-5.1-cp38-cp38-win_amd64.whl", hash = "sha256:79a3cfd6346ce6c13145731d39db47b7a7b859c0272f02cdb89a3bdcbae233a0"}, - {file = "coverage-5.1-cp39-cp39-win32.whl", hash = "sha256:a82b92b04a23d3c8a581fc049228bafde988abacba397d57ce95fe95e0338ab4"}, - {file = "coverage-5.1-cp39-cp39-win_amd64.whl", hash = "sha256:bb28a7245de68bf29f6fb199545d072d1036a1917dca17a1e75bbb919e14ee8e"}, - {file = "coverage-5.1.tar.gz", hash = "sha256:f90bfc4ad18450c80b024036eaf91e4a246ae287701aaa88eaebebf150868052"}, + {file = "coverage-5.2-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:d9ad0a988ae20face62520785ec3595a5e64f35a21762a57d115dae0b8fb894a"}, + {file = "coverage-5.2-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:4bb385a747e6ae8a65290b3df60d6c8a692a5599dc66c9fa3520e667886f2e10"}, + {file = "coverage-5.2-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:9702e2cb1c6dec01fb8e1a64c015817c0800a6eca287552c47a5ee0ebddccf62"}, + {file = "coverage-5.2-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:42fa45a29f1059eda4d3c7b509589cc0343cd6bbf083d6118216830cd1a51613"}, + {file = "coverage-5.2-cp27-cp27m-win32.whl", hash = "sha256:41d88736c42f4a22c494c32cc48a05828236e37c991bd9760f8923415e3169e4"}, + {file = "coverage-5.2-cp27-cp27m-win_amd64.whl", hash = "sha256:bbb387811f7a18bdc61a2ea3d102be0c7e239b0db9c83be7bfa50f095db5b92a"}, + {file = "coverage-5.2-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:3740b796015b889e46c260ff18b84683fa2e30f0f75a171fb10d2bf9fb91fc70"}, + {file = "coverage-5.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ebf2431b2d457ae5217f3a1179533c456f3272ded16f8ed0b32961a6d90e38ee"}, + {file = "coverage-5.2-cp35-cp35m-macosx_10_13_x86_64.whl", hash = "sha256:d54d7ea74cc00482a2410d63bf10aa34ebe1c49ac50779652106c867f9986d6b"}, + {file = "coverage-5.2-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:87bdc8135b8ee739840eee19b184804e5d57f518578ffc797f5afa2c3c297913"}, + {file = "coverage-5.2-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:ed9a21502e9223f563e071759f769c3d6a2e1ba5328c31e86830368e8d78bc9c"}, + {file = "coverage-5.2-cp35-cp35m-win32.whl", hash = "sha256:509294f3e76d3f26b35083973fbc952e01e1727656d979b11182f273f08aa80b"}, + {file = "coverage-5.2-cp35-cp35m-win_amd64.whl", hash = "sha256:ca63dae130a2e788f2b249200f01d7fa240f24da0596501d387a50e57aa7075e"}, + {file = "coverage-5.2-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:5c74c5b6045969b07c9fb36b665c9cac84d6c174a809fc1b21bdc06c7836d9a0"}, + {file = "coverage-5.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:c32aa13cc3fe86b0f744dfe35a7f879ee33ac0a560684fef0f3e1580352b818f"}, + {file = "coverage-5.2-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:1e58fca3d9ec1a423f1b7f2aa34af4f733cbfa9020c8fe39ca451b6071237405"}, + {file = "coverage-5.2-cp36-cp36m-win32.whl", hash = "sha256:3b2c34690f613525672697910894b60d15800ac7e779fbd0fccf532486c1ba40"}, + {file = "coverage-5.2-cp36-cp36m-win_amd64.whl", hash = "sha256:a4d511012beb967a39580ba7d2549edf1e6865a33e5fe51e4dce550522b3ac0e"}, + {file = "coverage-5.2-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:32ecee61a43be509b91a526819717d5e5650e009a8d5eda8631a59c721d5f3b6"}, + {file = "coverage-5.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:6f91b4492c5cde83bfe462f5b2b997cdf96a138f7c58b1140f05de5751623cf1"}, + {file = "coverage-5.2-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:bfcc811883699ed49afc58b1ed9f80428a18eb9166422bce3c31a53dba00fd1d"}, + {file = "coverage-5.2-cp37-cp37m-win32.whl", hash = "sha256:60a3d36297b65c7f78329b80120f72947140f45b5c7a017ea730f9112b40f2ec"}, + {file = "coverage-5.2-cp37-cp37m-win_amd64.whl", hash = "sha256:12eaccd86d9a373aea59869bc9cfa0ab6ba8b1477752110cb4c10d165474f703"}, + {file = "coverage-5.2-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:d82db1b9a92cb5c67661ca6616bdca6ff931deceebb98eecbd328812dab52032"}, + {file = "coverage-5.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:214eb2110217f2636a9329bc766507ab71a3a06a8ea30cdeebb47c24dce5972d"}, + {file = "coverage-5.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8a3decd12e7934d0254939e2bf434bf04a5890c5bf91a982685021786a08087e"}, + {file = "coverage-5.2-cp38-cp38-win32.whl", hash = "sha256:1dcebae667b73fd4aa69237e6afb39abc2f27520f2358590c1b13dd90e32abe7"}, + {file = "coverage-5.2-cp38-cp38-win_amd64.whl", hash = "sha256:f50632ef2d749f541ca8e6c07c9928a37f87505ce3a9f20c8446ad310f1aa87b"}, + {file = "coverage-5.2-cp39-cp39-macosx_10_13_x86_64.whl", hash = "sha256:7403675df5e27745571aba1c957c7da2dacb537c21e14007ec3a417bf31f7f3d"}, + {file = "coverage-5.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:0fc4e0d91350d6f43ef6a61f64a48e917637e1dcfcba4b4b7d543c628ef82c2d"}, + {file = "coverage-5.2-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:25fe74b5b2f1b4abb11e103bb7984daca8f8292683957d0738cd692f6a7cc64c"}, + {file = "coverage-5.2-cp39-cp39-win32.whl", hash = "sha256:d67599521dff98ec8c34cd9652cbcfe16ed076a2209625fca9dc7419b6370e5c"}, + {file = "coverage-5.2-cp39-cp39-win_amd64.whl", hash = "sha256:10f2a618a6e75adf64329f828a6a5b40244c1c50f5ef4ce4109e904e69c71bd2"}, + {file = "coverage-5.2.tar.gz", hash = "sha256:1874bdc943654ba46d28f179c1846f5710eda3aeb265ff029e0ac2b52daae404"}, +] +distlib = [ + {file = "distlib-0.3.1-py2.py3-none-any.whl", hash = "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb"}, + {file = "distlib-0.3.1.zip", hash = "sha256:edf6116872c863e1aa9d5bb7cb5e05a022c519a4594dc703843343a9ddd9bff1"}, ] docutils = [ {file = "docutils-0.16-py2.py3-none-any.whl", hash = "sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af"}, {file = "docutils-0.16.tar.gz", hash = "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"}, ] +filelock = [ + {file = "filelock-3.0.12-py3-none-any.whl", hash = "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"}, + {file = "filelock-3.0.12.tar.gz", hash = "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"}, +] flake8 = [ {file = "flake8-3.8.3-py2.py3-none-any.whl", hash = "sha256:15e351d19611c887e482fb960eae4d44845013cc142d42896e9862f775d8cf5c"}, {file = "flake8-3.8.3.tar.gz", hash = "sha256:f04b9fcbac03b0a3e58c0ab3a0ecc462e023a9faf046d57794184028123aa208"}, ] identify = [ - {file = "identify-1.4.19-py2.py3-none-any.whl", hash = "sha256:781fd3401f5d2b17b22a8b18b493a48d5d948e3330634e82742e23f9c20234ef"}, - {file = "identify-1.4.19.tar.gz", hash = "sha256:249ebc7e2066d6393d27c1b1be3b70433f824a120b1d8274d362f1eb419e3b52"}, + {file = "identify-1.4.23-py2.py3-none-any.whl", hash = "sha256:882c4b08b4569517b5f2257ecca180e01f38400a17f429f5d0edff55530c41c7"}, + {file = "identify-1.4.23.tar.gz", hash = "sha256:f89add935982d5bc62913ceee16c9297d8ff14b226e9d3072383a4e38136b656"}, ] idna = [ - {file = "idna-2.9-py2.py3-none-any.whl", hash = "sha256:a068a21ceac8a4d63dbfd964670474107f541babbd2250d61922f029858365fa"}, - {file = "idna-2.9.tar.gz", hash = "sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb"}, + {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, + {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, ] imagesize = [ {file = "imagesize-1.2.0-py2.py3-none-any.whl", hash = "sha256:6965f19a6a2039c7d48bca7dba2473069ff854c36ae6f19d2cde309d998228a1"}, {file = "imagesize-1.2.0.tar.gz", hash = "sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1"}, ] importlib-metadata = [ - {file = "importlib_metadata-1.6.1-py2.py3-none-any.whl", hash = "sha256:15ec6c0fd909e893e3a08b3a7c76ecb149122fb14b7efe1199ddd4c7c57ea958"}, - {file = "importlib_metadata-1.6.1.tar.gz", hash = "sha256:0505dd08068cfec00f53a74a0ad927676d7757da81b7436a6eefe4c7cf75c545"}, + {file = "importlib_metadata-1.7.0-py2.py3-none-any.whl", hash = "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070"}, + {file = "importlib_metadata-1.7.0.tar.gz", hash = "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83"}, ] importlib-resources = [ - {file = "importlib_resources-2.0.0-py2.py3-none-any.whl", hash = "sha256:a86462cf34a6d391d1d5d598a5e2f5aac9fc00b265d40542e1196328f015d1f6"}, - {file = "importlib_resources-2.0.0.tar.gz", hash = "sha256:7f6aae2ed252ba10f5d1af5676b0e35f3b3eb7d3cc103b8365cc92aec0c79258"}, + {file = "importlib_resources-3.0.0-py2.py3-none-any.whl", hash = "sha256:d028f66b66c0d5732dae86ba4276999855e162a749c92620a38c1d779ed138a7"}, + {file = "importlib_resources-3.0.0.tar.gz", hash = "sha256:19f745a6eca188b490b1428c8d1d4a0d2368759f32370ea8fb89cad2ab1106c3"}, ] isort = [ {file = "isort-4.3.21-py2.py3-none-any.whl", hash = "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"}, @@ -958,11 +958,8 @@ mccabe = [ {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, ] more-itertools = [ - {file = "more-itertools-8.3.0.tar.gz", hash = "sha256:558bb897a2232f5e4f8e2399089e35aecb746e1f9191b6584a151647e89267be"}, - {file = "more_itertools-8.3.0-py3-none-any.whl", hash = "sha256:7818f596b1e87be009031c7653d01acc46ed422e6656b394b0f765ce66ed4982"}, -] -nested-lookup = [ - {file = "nested-lookup-0.2.21.tar.gz", hash = "sha256:23789e328bd1d0b3f9db93cf51b7103a978dd0d8a834770d2c19b365e934ab96"}, + {file = "more-itertools-8.4.0.tar.gz", hash = "sha256:68c70cc7167bdf5c7c9d8f6954a7837089c6a36bf565383919bb595efb8a17e5"}, + {file = "more_itertools-8.4.0-py3-none-any.whl", hash = "sha256:b78134b2063dd214000685165d81c154522c3ee0a1c0d4d113c80361c234c5a2"}, ] nodeenv = [ {file = "nodeenv-1.4.0-py2.py3-none-any.whl", hash = "sha256:4b0b77afa3ba9b54f4b6396e60b0c83f59eaeb2d63dc3cc7a70f7f4af96c82bc"}, @@ -971,10 +968,6 @@ packaging = [ {file = "packaging-20.4-py2.py3-none-any.whl", hash = "sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181"}, {file = "packaging-20.4.tar.gz", hash = "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"}, ] -pathlib2 = [ - {file = "pathlib2-2.3.5-py2.py3-none-any.whl", hash = "sha256:0ec8205a157c80d7acc301c0b18fbd5d44fe655968f5d947b6ecef5290fc35db"}, - {file = "pathlib2-2.3.5.tar.gz", hash = "sha256:6cd9a47b597b37cc57de1c05e56fb1a1c9cc9fab04fe78c29acd090418529868"}, -] pathspec = [ {file = "pathspec-0.8.0-py2.py3-none-any.whl", hash = "sha256:7d91249d21749788d07a2d0f94147accd8f845507400749ea19c1ec9054a12b0"}, {file = "pathspec-0.8.0.tar.gz", hash = "sha256:da45173eb3a6f2a5a487efba21f050af2b41948be6ab52b6a1e3ff22bb8b7061"}, @@ -988,8 +981,8 @@ pre-commit = [ {file = "pre_commit-1.21.0.tar.gz", hash = "sha256:8f48d8637bdae6fa70cc97db9c1dd5aa7c5c8bf71968932a380628c25978b850"}, ] py = [ - {file = "py-1.8.1-py2.py3-none-any.whl", hash = "sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0"}, - {file = "py-1.8.1.tar.gz", hash = "sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa"}, + {file = "py-1.9.0-py2.py3-none-any.whl", hash = "sha256:366389d1db726cd2fcfc79732e75410e5fe4d31db13692115529d34069a043c2"}, + {file = "py-1.9.0.tar.gz", hash = "sha256:9ca6883ce56b4e8da7e79ac18787889fa5206c79dcc67fb065376cd2fe03f342"}, ] pycodestyle = [ {file = "pycodestyle-2.6.0-py2.py3-none-any.whl", hash = "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367"}, @@ -1012,11 +1005,11 @@ pytest = [ {file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"}, ] pytest-cov = [ - {file = "pytest-cov-2.9.0.tar.gz", hash = "sha256:b6a814b8ed6247bd81ff47f038511b57fe1ce7f4cc25b9106f1a4b106f1d9322"}, - {file = "pytest_cov-2.9.0-py2.py3-none-any.whl", hash = "sha256:c87dfd8465d865655a8213859f1b4749b43448b5fae465cb981e16d52a811424"}, + {file = "pytest-cov-2.10.0.tar.gz", hash = "sha256:1a629dc9f48e53512fcbfda6b07de490c374b0c83c55ff7a1720b3fccff0ac87"}, + {file = "pytest_cov-2.10.0-py2.py3-none-any.whl", hash = "sha256:6e6d18092dce6fad667cd7020deed816f858ad3b49d5b5e2b1cc1c97a4dba65c"}, ] pytest-sugar = [ - {file = "pytest-sugar-0.9.3.tar.gz", hash = "sha256:1630b5b7ea3624919b73fde37cffb87965c5087a4afab8a43074ff44e0d810c4"}, + {file = "pytest-sugar-0.9.4.tar.gz", hash = "sha256:b1b2186b0a72aada6859bea2a5764145e3aaa2c1cfbb23c3a19b5f7b697563d3"}, ] pytz = [ {file = "pytz-2020.1-py2.py3-none-any.whl", hash = "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed"}, @@ -1036,31 +1029,31 @@ pyyaml = [ {file = "PyYAML-5.3.1.tar.gz", hash = "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"}, ] regex = [ - {file = "regex-2020.6.8-cp27-cp27m-win32.whl", hash = "sha256:fbff901c54c22425a5b809b914a3bfaf4b9570eee0e5ce8186ac71eb2025191c"}, - {file = "regex-2020.6.8-cp27-cp27m-win_amd64.whl", hash = "sha256:112e34adf95e45158c597feea65d06a8124898bdeac975c9087fe71b572bd938"}, - {file = "regex-2020.6.8-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:92d8a043a4241a710c1cf7593f5577fbb832cf6c3a00ff3fc1ff2052aff5dd89"}, - {file = "regex-2020.6.8-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:bae83f2a56ab30d5353b47f9b2a33e4aac4de9401fb582b55c42b132a8ac3868"}, - {file = "regex-2020.6.8-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:b2ba0f78b3ef375114856cbdaa30559914d081c416b431f2437f83ce4f8b7f2f"}, - {file = "regex-2020.6.8-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:95fa7726d073c87141f7bbfb04c284901f8328e2d430eeb71b8ffdd5742a5ded"}, - {file = "regex-2020.6.8-cp36-cp36m-win32.whl", hash = "sha256:e3cdc9423808f7e1bb9c2e0bdb1c9dc37b0607b30d646ff6faf0d4e41ee8fee3"}, - {file = "regex-2020.6.8-cp36-cp36m-win_amd64.whl", hash = "sha256:c78e66a922de1c95a208e4ec02e2e5cf0bb83a36ceececc10a72841e53fbf2bd"}, - {file = "regex-2020.6.8-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:08997a37b221a3e27d68ffb601e45abfb0093d39ee770e4257bd2f5115e8cb0a"}, - {file = "regex-2020.6.8-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:2f6f211633ee8d3f7706953e9d3edc7ce63a1d6aad0be5dcee1ece127eea13ae"}, - {file = "regex-2020.6.8-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:55b4c25cbb3b29f8d5e63aeed27b49fa0f8476b0d4e1b3171d85db891938cc3a"}, - {file = "regex-2020.6.8-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:89cda1a5d3e33ec9e231ece7307afc101b5217523d55ef4dc7fb2abd6de71ba3"}, - {file = "regex-2020.6.8-cp37-cp37m-win32.whl", hash = "sha256:690f858d9a94d903cf5cada62ce069b5d93b313d7d05456dbcd99420856562d9"}, - {file = "regex-2020.6.8-cp37-cp37m-win_amd64.whl", hash = "sha256:1700419d8a18c26ff396b3b06ace315b5f2a6e780dad387e4c48717a12a22c29"}, - {file = "regex-2020.6.8-cp38-cp38-manylinux1_i686.whl", hash = "sha256:654cb773b2792e50151f0e22be0f2b6e1c3a04c5328ff1d9d59c0398d37ef610"}, - {file = "regex-2020.6.8-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:52e1b4bef02f4040b2fd547357a170fc1146e60ab310cdbdd098db86e929b387"}, - {file = "regex-2020.6.8-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:cf59bbf282b627130f5ba68b7fa3abdb96372b24b66bdf72a4920e8153fc7910"}, - {file = "regex-2020.6.8-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:5aaa5928b039ae440d775acea11d01e42ff26e1561c0ffcd3d805750973c6baf"}, - {file = "regex-2020.6.8-cp38-cp38-win32.whl", hash = "sha256:97712e0d0af05febd8ab63d2ef0ab2d0cd9deddf4476f7aa153f76feef4b2754"}, - {file = "regex-2020.6.8-cp38-cp38-win_amd64.whl", hash = "sha256:6ad8663c17db4c5ef438141f99e291c4d4edfeaacc0ce28b5bba2b0bf273d9b5"}, - {file = "regex-2020.6.8.tar.gz", hash = "sha256:e9b64e609d37438f7d6e68c2546d2cb8062f3adb27e6336bc129b51be20773ac"}, + {file = "regex-2020.7.14-cp27-cp27m-win32.whl", hash = "sha256:e46d13f38cfcbb79bfdb2964b0fe12561fe633caf964a77a5f8d4e45fe5d2ef7"}, + {file = "regex-2020.7.14-cp27-cp27m-win_amd64.whl", hash = "sha256:6961548bba529cac7c07af2fd4d527c5b91bb8fe18995fed6044ac22b3d14644"}, + {file = "regex-2020.7.14-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:c50a724d136ec10d920661f1442e4a8b010a4fe5aebd65e0c2241ea41dbe93dc"}, + {file = "regex-2020.7.14-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:8a51f2c6d1f884e98846a0a9021ff6861bdb98457879f412fdc2b42d14494067"}, + {file = "regex-2020.7.14-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:9c568495e35599625f7b999774e29e8d6b01a6fb684d77dee1f56d41b11b40cd"}, + {file = "regex-2020.7.14-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:51178c738d559a2d1071ce0b0f56e57eb315bcf8f7d4cf127674b533e3101f88"}, + {file = "regex-2020.7.14-cp36-cp36m-win32.whl", hash = "sha256:9eddaafb3c48e0900690c1727fba226c4804b8e6127ea409689c3bb492d06de4"}, + {file = "regex-2020.7.14-cp36-cp36m-win_amd64.whl", hash = "sha256:14a53646369157baa0499513f96091eb70382eb50b2c82393d17d7ec81b7b85f"}, + {file = "regex-2020.7.14-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:1269fef3167bb52631ad4fa7dd27bf635d5a0790b8e6222065d42e91bede4162"}, + {file = "regex-2020.7.14-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:d0a5095d52b90ff38592bbdc2644f17c6d495762edf47d876049cfd2968fbccf"}, + {file = "regex-2020.7.14-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:4c037fd14c5f4e308b8370b447b469ca10e69427966527edcab07f52d88388f7"}, + {file = "regex-2020.7.14-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:bc3d98f621898b4a9bc7fecc00513eec8f40b5b83913d74ccb445f037d58cd89"}, + {file = "regex-2020.7.14-cp37-cp37m-win32.whl", hash = "sha256:46bac5ca10fb748d6c55843a931855e2727a7a22584f302dd9bb1506e69f83f6"}, + {file = "regex-2020.7.14-cp37-cp37m-win_amd64.whl", hash = "sha256:0dc64ee3f33cd7899f79a8d788abfbec168410be356ed9bd30bbd3f0a23a7204"}, + {file = "regex-2020.7.14-cp38-cp38-manylinux1_i686.whl", hash = "sha256:5ea81ea3dbd6767873c611687141ec7b06ed8bab43f68fad5b7be184a920dc99"}, + {file = "regex-2020.7.14-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:bbb332d45b32df41200380fff14712cb6093b61bd142272a10b16778c418e98e"}, + {file = "regex-2020.7.14-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:c11d6033115dc4887c456565303f540c44197f4fc1a2bfb192224a301534888e"}, + {file = "regex-2020.7.14-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:75aaa27aa521a182824d89e5ab0a1d16ca207318a6b65042b046053cfc8ed07a"}, + {file = "regex-2020.7.14-cp38-cp38-win32.whl", hash = "sha256:d6cff2276e502b86a25fd10c2a96973fdb45c7a977dca2138d661417f3728341"}, + {file = "regex-2020.7.14-cp38-cp38-win_amd64.whl", hash = "sha256:7a2dd66d2d4df34fa82c9dc85657c5e019b87932019947faece7983f2089a840"}, + {file = "regex-2020.7.14.tar.gz", hash = "sha256:3a3af27a8d23143c49a3420efe5b3f8cf1a48c6fc8bc6856b03f638abc1833bb"}, ] requests = [ - {file = "requests-2.23.0-py2.py3-none-any.whl", hash = "sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee"}, - {file = "requests-2.23.0.tar.gz", hash = "sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6"}, + {file = "requests-2.24.0-py2.py3-none-any.whl", hash = "sha256:fe75cc94a9443b9246fc7049224f75604b113c36acb93f87b80ed42c44cbb898"}, + {file = "requests-2.24.0.tar.gz", hash = "sha256:b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b"}, ] seed-isort-config = [ {file = "seed_isort_config-2.2.0-py2.py3-none-any.whl", hash = "sha256:8601fb715a5a4aac39256bbf73c2da6a81f964da9c9d9897ab9074db3663526f"}, @@ -1145,14 +1138,14 @@ urllib3 = [ {file = "urllib3-1.25.9.tar.gz", hash = "sha256:3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527"}, ] virtualenv = [ - {file = "virtualenv-16.7.10-py2.py3-none-any.whl", hash = "sha256:105893c8dc66b7817691c7371439ec18e3b6c5e323a304b5ed96cdd2e75cc1ec"}, - {file = "virtualenv-16.7.10.tar.gz", hash = "sha256:e88fdcb08b0ecb11da97868f463dd06275923f50d87f4b9c8b2fc0994eec40f4"}, + {file = "virtualenv-20.0.27-py2.py3-none-any.whl", hash = "sha256:c51f1ba727d1614ce8fd62457748b469fbedfdab2c7e5dd480c9ae3fbe1233f1"}, + {file = "virtualenv-20.0.27.tar.gz", hash = "sha256:26cdd725a57fef4c7c22060dba4647ebd8ca377e30d1c1cf547b30a0b79c43b4"}, ] wcwidth = [ - {file = "wcwidth-0.2.4-py2.py3-none-any.whl", hash = "sha256:79375666b9954d4a1a10739315816324c3e73110af9d0e102d906fdb0aec009f"}, - {file = "wcwidth-0.2.4.tar.gz", hash = "sha256:8c6b5b6ee1360b842645f336d9e5d68c55817c26d3050f46b235ef2bc650e48f"}, + {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, + {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, ] zipp = [ - {file = "zipp-1.2.0-py2.py3-none-any.whl", hash = "sha256:e0d9e63797e483a30d27e09fffd308c59a700d365ec34e93cc100844168bf921"}, - {file = "zipp-1.2.0.tar.gz", hash = "sha256:c70410551488251b0fee67b460fb9a536af8d6f9f008ad10ac51f615b6a521b1"}, + {file = "zipp-3.1.0-py3-none-any.whl", hash = "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b"}, + {file = "zipp-3.1.0.tar.gz", hash = "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96"}, ] diff --git a/pyproject.toml b/pyproject.toml index bdf9ba3..dc93234 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,10 @@ description = "Modify configuration files of various formats with the same simpl authors = ["Eugene Triguba <eugenetriguba@gmail.com>"] readme = "README.md" repository = "https://github.com/eugenetriguba/config_file" -keywords = ["configuration", "config file", "ini", "json", "toml", "yaml"] +documentation = "https://config-file.readthedocs.io/" +keywords = ["configuration", "ini", "json", "toml", "yaml"] classifiers = [ - "Development Status :: 2 - Pre-Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", @@ -27,7 +28,6 @@ pytest = "poetry run pytest tests/" [tool.poetry.dependencies] python = "^3.6" -nested-lookup = "^0.2.21" toml = { version = "^0.10.0", optional = true } pyyaml = { version = "^5.3.1", optional = true } @@ -59,7 +59,7 @@ include = '\.pyi?$' line_length = 88 multi_line_output = 3 include_trailing_comma = true -known_third_party = ["nested_lookup", "pytest"] +known_third_party = ["pytest", "pyyaml", "toml"] known_first_party = ["config_file"] [build-system] diff --git a/tests/test_lookup_api.py b/tests/test_lookup_api.py index 6a5cc87..f7b7cc3 100644 --- a/tests/test_lookup_api.py +++ b/tests/test_lookup_api.py @@ -1,7 +1,7 @@ from unittest import TestCase -from nested_lookup import nested_lookup, nested_update -from nested_lookup import nested_delete, nested_alter +from config_file.nested_lookup import nested_lookup, nested_update +from config_file.nested_lookup import nested_delete, nested_alter class BaseLookUpApi(TestCase): diff --git a/tests/test_nested_lookup.py b/tests/test_nested_lookup.py index b1bf44b..6c1cc83 100644 --- a/tests/test_nested_lookup.py +++ b/tests/test_nested_lookup.py @@ -1,6 +1,6 @@ from unittest import TestCase -from nested_lookup import ( +from config_file.nested_lookup import ( nested_lookup, get_all_keys, get_occurrence_of_key, |