"""sophon python module
"""
__all__ = []

try:
    import numpy
except ImportError:
    print('SAIL bindings requires "numpy" package.')
    print('Install it via command:')
    print('   pip3 install numpy')
    raise

import os
from sqlite_vfs.core import SQLiteVFS
import json


def get_config(json_path: str, is_vfs: bool = False, vfs_path: str="./application.svfs"):
    if is_vfs:
        vfs = SQLiteVFS(vfs_path)
        data = json.loads(vfs.read_file(json_path))
    else:
        with open(json_path, 'r') as file:
            data = json.load(file)
    return data
