Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Python中修改SSAS表格模型?_Python_Powershell - Fatal编程技术网

如何在Python中修改SSAS表格模型?

如何在Python中修改SSAS表格模型?,python,powershell,Python,Powershell,我正在尝试对SSAS表格模型进行更改,例如更改数据源等 我已经用python生成了一个脚本,它能够更改JSON,能够识别、移动和进行更改。但我正在寻找一个特定的包,它可以作为适当的模型而不是JSON对象来处理这个问题 f = open('C:\\path\\to\\my\\model.bim', 'r') jsondata = json.load(f) result = nested_delete( document = jsondata, key = 'dataSources

我正在尝试对SSAS表格模型进行更改,例如更改数据源等

我已经用python生成了一个脚本,它能够更改JSON,能够识别、移动和进行更改。但我正在寻找一个特定的包,它可以作为适当的模型而不是JSON对象来处理这个问题

f = open('C:\\path\\to\\my\\model.bim', 'r')
jsondata = json.load(f)

result = nested_delete(
    document = jsondata,
    key = 'dataSources')

result['model']['dataSources'] = [
    {'name': "SQL Database",
    'connectionString': "xxxxxxxxxx"}
]

result = nested_update(
    document = result,
    key = 'dataSource',
    value = 'SQL Database'
) 

with open('C:\\path\\to\\my\\newmodel.bim', 'w') as file:
    json.dump(result, file, indent=2)

我的想法是做一些类似于上面python脚本的事情,但是按照假设的方式处理模型,因为我使用的是一个巨大的模型。我对Python和Powershell中的代码持开放态度

您是否尝试过使用表格编辑器?这是一个轻量级的SSAS表格IDE:

您尝试过给表格编辑器一个机会吗?它是一个轻量级SSAS表格IDE: