tgo*_*n18 5 python sharepoint pandas
我有几个从 Sharepoint 查询数据的 .iqy 文件。我需要在 Python Pandas 中组合和处理这些。Python有办法做到这一点吗?我知道 Python Sharepoint 库存在,但我试图避免通过 Python 设置自己的连接,而是依赖 .iqy 文件。有任何想法吗?
为了回答这个问题,假设该表如下所示:
+------+------+
| col1 | col2 |
+------+------+
| 1 | 2 |
| 3 | 4 |
+------+------+
Run Code Online (Sandbox Code Playgroud)
此外,我愿意接受非 Python 解决方案,以获取自动运行 .iqy 查询并将数据转换为 Python 可读格式(例如 .csv)的方法。但不确定这种方法是什么样的
这是一个小技巧:
import requests_ntlm
import requests
url = 'https://..../owssvr.dll?XMLDATA=...'
print('downloading...')
r = requests.get(url, auth=requests_ntlm.HttpNtlmAuth(LOGIN, PASSWORD), verify=False)
print('saving...')
with open('download.xml', 'wb') as file:
file.write(r.content)
Run Code Online (Sandbox Code Playgroud)
几点说明:
url位于 *.iqy 文件中(通常很长)。您可以通过“记事本”手动提取它,也可以通过python解析它。| 归档时间: |
|
| 查看次数: |
5949 次 |
| 最近记录: |