from types import SimpleNamespace
import json
import sys
import robot

class NestedNamespace(SimpleNamespace):
    def __init__(self, dictionary, **kwargs):
        super().__init__(**kwargs)
        for key, value in dictionary.items():
            if isinstance(value, dict):
                self.__setattr__(key, NestedNamespace(value))
            else:
                self.__setattr__(key, value)

with open("profiles.json", "r") as read_file:
    data = json.load(read_file)

operator = NestedNamespace(data)

print(operator.WEBSITE.urls.uat)

# nested_namespace = NestedNamespace({
#     'parent': {
#         'child': {
#             'grandchild': 'value'
#         }
#     },
#     'normal_key': 'normal value',
# })
