# -*- coding: utf-8 -*-
from setuptools import setup

package_dir = \
{'': 'src'}

modules = \
['pydict_filter']
setup_kwargs = {
    'name': 'pydict-filter',
    'version': '0.1.7',
    'description': 'This package will help you to smart filter dictionary fields.',
    'long_description': '# py-dict-filter\nThis package allowed you to perform smart filtering for your dictionary.\n## deny_filter(filtering_dict, filter_list, current_path="")\nWhen you use this method, you specify which fields to filter out. For example, we have next dictionary:\n```\n{\n    "top_key_1": "top_value",\n    "top_key_2": {\n        "middle_key_1": "middle_value",\n        "middle_key_2": "middle_value",\n        "middle_key_3": "middle_value"\n    },\n    "top_key_3": [\n        {\n            "middle_key_4": "middle_value",\n            "middle_key_5": "middle_value"\n        }\n    ],\n    "top_key_4": "top_value"\n}\n```\n\nIf you want to deny some fields, you need to add these fields in the filter_list. Here cases filter string and examples:\n- Deny top level fields: `top_key_1`, `top_key_3` etc.\n- Deny all top level fields: `*`\n- Deny fields from nested dict: `top_key_2.middle_key_2`, `top_key_3.middle_key_5`\n- Deny all fields from nested dict: `top_key_2.*`, `top_key_3.*`\n\nFor example if you call this method with example dictionary as filtering_dict and `filter_list=["top_key_4", "top_key_3.middle_key_4", "top_key_2.*"]`\nyou will get next result:\n\n```\n{\n    "top_key_1": "top_value",\n    "top_key_3": [\n        {\n            "middle_key_5": "middle_value"\n        }\n    ],\n    "top_key_2": {}\n}\n```\n\n## allow_filter(filtering_dict, filter_list, current_path=""):\nWhen you use this method, you specify which fields should be present in a dictionary. For example, we have next dictionary:\n```\n{\n    "top_key_1": "top_value",\n    "top_key_2": {\n        "middle_key_1": "middle_value",\n        "middle_key_2": "middle_value",\n        "middle_key_3": "middle_value",\n        "middle_key_4": {\n            "low_level_key_1": "low_value",\n            "low_level_key_2": "low_value"\n        }\n    },\n    "top_key_3": [\n        {\n            "middle_key_4": "middle_value",\n            "middle_key_5": "middle_value"\n        }\n    ],\n    "top_key_4": "top_value"\n}\n```\n\nIf you want to deny some fields, you need to add this fields in the filter_list. Here cases filter string and examples:\n- Allow top level fields: `top_key_1`, `top_key_3` etc.\n- Allow all top level fields: `*`\n- Allow fields from nested dict: `top_key_2.middle_key_2`, `top_key_3.middle_key_5`, `top_key_2.middle_key_4.low_level_key_2`\n- Allow all fields from nested dict: `top_key_2.*`, `top_key_3.*`, `top_key_2.middle_key_4.*`\n\nFor example if you call this method with example dictionary as filtering_dict and `filter_list=["top_key_1", "top_key_2", \n"top_key_3", "top_key_3.*", "top_key_2.middle_key_1", "top_key_2.middle_key_2", "top_key_2.middle_key_4.*"]`\nyou will get next result:\n\n```\n{\n    "top_key_1": "top_value",\n    "top_key_3": [\n        {\n            "middle_key_4": "middle_value",\n            "middle_key_5": "middle_value"\n        }\n    ],\n    "top_key_2": {\n        "middle_key_2": "middle_value",\n        "middle_key_1": "middle_value"\n    }\n}\n```\n\n**PAY ATTENTION!** Despite the fact that all fields for `top_key_2.middle_key_4` were allowed, they did not present in the result. \nThis happened because `top_key_2.middle_key_4` was not allowed in `top_key_2` dictionary.\n\n## none_values_filter(filtering_dict, filter_list, current_path="", recursive=True, is_reversed=False)\nWhen you use this method, you specify which fields should be checked and depend on `is_reversed`, method will allow or deny None values for these fields. <br>\nIf `is_reversed=False`, the method will remove None fields that present in the filter_list. <br>\nIf `is_reversed=True`, the method will remove None fields that not present in the filter_list. <br>\nIf `recursive=True`, the method will check all dictionary fields.<br>\nIf `recursive=False`, the method will check only top-level dictionary fields.<br>\n\nFor example, we have next dictionary:\n```\n{\n    "top_key_1": "top_value",\n    "top_key_2": {\n        "middle_key_1": "middle_value",\n        "middle_key_2": None,\n        "middle_key_3": None,\n        "middle_key_4": {\n            "low_level_key_1": "low_value",\n            "low_level_key_2": None\n        }\n    },\n    "top_key_3": [\n        {\n            "middle_key_4": "middle_value",\n            "middle_key_5": None\n        }\n    ],\n    "top_key_4": None\n}\n```\nIf you want to deny (is_reversed=False) or allow (is_reversed=True) None value for some fields, you need to add this fields in the `filter_list`. Here cases filter string and examples:\n- Allow or deny top level fields: `top_key_1`, `top_key_4` etc.\n- Allow or deny all top level fields: `*`\n- Allow or deny fields from nested dict: `top_key_2.middle_key_2`, `top_key_3.middle_key_5`, `top_key_2.middle_key_4.low_level_key_2`\n- Allow or deny all fields from nested dict: `top_key_2.*`, `top_key_3.*`, `top_key_2.middle_key_4.*`\n\nFor example if you call this method with example dictionary as filtering_dict and `filter_list=["top_key_1", "top_key_2", \n"top_key_3", "top_key_3.*", "top_key_2.middle_key_1", "top_key_2.middle_key_2", "top_key_2.middle_key_4.*"]`, recursive=True, is_reversed=False\nyou will get next result:\n\n```\n{\n    "top_key_1": "top_value",\n    "top_key_3": [\n        {\n            "middle_key_4": "middle_value"\n        }\n    ],\n    "top_key_2": {\n        "middle_key_3": None,\n        "middle_key_1": "middle_value",\n        "middle_key_4": {\n            "low_level_key_1": "low_value"\n        }\n    }\n}\n```\n## Dots in the dict keys\n\nThere can also be a situation when the dict keys contain a `"."` symbol that obviously will confront the `filter_list` declaration.\n\nIf you need to identify such a field in the filter_list you need to wrap the `"."` into `"()"` -> `"(.)"`.\n\nFor example we have such a dictionary:\n```\n{\n    "top.key_1": "top_value",\n    "top.key_2": [\n        {\n            "middle_key_1": "middle_value"\n        }\n    ],\n    "top_key_3": {\n        "middle.key_1": "middle_value",\n        "middle_key_2": {\n            "low_level_key_1": "low_value"\n        },\n        "middle.key_3": "middle_value"\n    }\n}\n```\n\nTo identify `middle_key_1` we need to use such filter config: `[\'top(.)key_2\', \'top(.)key_2.middle_key_1\']`. But the `\'*\'` still works fine: `[\'*\', \'*.middle_key_1\']`.\n\nAnother example: `[\'*\', \'*.middle(.)key_1\', \'*.middle_key_2\', \'*.middle_key_2.low_level_key_1\']`\n\n**PAY ATTENTION!** You need to use `\'(.)\'` only if you need to specify the exact field name that contains `\'.\'`.\n',
    'author': 'Kamenlom',
    'author_email': 'ivashchenko.roman111@gmail.com',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'https://github.com/Nextpertise/py-dict-filter',
    'package_dir': package_dir,
    'py_modules': modules,
    'python_requires': '>=3.8,<4.0',
}


setup(**setup_kwargs)
