# Path: pynYNAB/scripts/helpers.py
# def get_config_from_yaml(config_file=DEFAULT_CONFIG_FILE):
#     try:
#         with open(config_file, 'r') as stream:
#             yaml_content = yaml.load(stream)
#             if yaml_content is not None:
#                 return yaml_content
#     except:
#         return {}


from pynYNAB.ClientFactory import nYnabClientFactory
from pynYNAB.scripts.helpers import get_config_from_yaml

config = get_config_from_yaml()

engine_url = 'sqlite:////tmp/persist.db'

factory1 = nYnabClientFactory(engine_url=engine_url)

client1 = factory1.create_client(**config)


# Path: pynYNAB/scripts/helpers.py
# def get_config_from_yaml(config_file=DEFAULT_CONFIG_FILE):
#     try:
#         with open(config_file, 'r') as stream:
#             yaml_content = yaml.load(stream)
#             if yaml_content is not None:
#                 return yaml_content
#     except:
#         return {}


# Path: testscripts/persist.py
from pynYNAB.ClientFactory import nYnabClientFactory
from pynYNAB.scripts.helpers import get_config_from_yaml


config = get_config_from_yaml()

engine_url = 'sqlite:////tmp/persist.db'

factory1 = nYnabClientFactory(engine_url=engine_url)

client1 = factory1.create_client(**config)


factory2 = nYnabClientFactory(engine_url=engine_url)