forked from SharadKumar97/OSINT-SPY
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
20 lines (18 loc) · 732 Bytes
/
Copy pathutils.py
File metadata and controls
20 lines (18 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
Utils functions -
"""
def format_dict(data, attribute=None):
for key, value in data.items():
if key != attribute:
if isinstance(value, dict):
if any(value.values()):
print(f'{key.capitalize()}::')
for sub_key, sub_value in value.items():
if sub_value:
print(f'\t{sub_key.capitalize()}:: {sub_value}')
elif isinstance(value, list):
if value:
print(f'{key.capitalize()}:: {", ".join(value) if isinstance(value[0], str) else value}')
else:
if value is not None:
print(f'{key.capitalize()}:: {value}')