from notion.client import NotionClient
from notion.settings import Settings


class Context:
    def __init__(self):
        self.settings = Settings.from_file()
        self._client = None

    def get_client(self):
        if not self._client:
            self.settings.validate()
            self._client = NotionClient(token_v2=self.settings.token, monitor=False)
        return self._client

    def update_settings(self, **kwargs):
        self.settings = self.settings.update(**kwargs)

[(7, 'notion.settings.Settings.from_file', 'Settings.from_file', False, 'from notion.settings import Settings\n'), (13, 'notion.client.NotionClient', 'NotionClient', False, 'from notion.client import NotionClient\n')]