def filter_list_entries(path: str, tags: list):
"""
Parameters
----------
path : str
path to json file like {"bl_townhall_lvl1.png": {"path": "bl_townhall_lvl1.png", "tags": ["tag"]}, ... }
Returns
-------
list
list of files with given tags
"""
with open(path, 'r') as read_file:
return [ value['path'] for key, value in json.load(read_file).items() if all(tag in value['tags'] for tag in tags) ]
Comments