MPContribs API客户端库
项目描述
一个小型、动态的Python客户端库,用于连接基于Yelp的
from mpcontribs.client import Client
client = Client()
dir(client) # show available resources
默认情况下,客户端连接到https://contribs-api.materialsproject.org,并使用环境变量MPCONTRIBS_API_KEY
设置API密钥。密钥也可以通过构造函数的apikey
参数显式设置。可以通过设置host
参数或环境变量MPCONTRIBS_API_HOST
来连接到其他MPContribs风格的API。
client = Client(host='ml-api.materialsproject.org')
故障排除
twisted.web._newclient.ResponseNeverReceived:
[<twisted.python.failure.Failure OpenSSL.SSL.Error:
[('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]>]
将环境变量SSL_CERT_FILE
设置为$(python -m certifi)
。
OverflowError: timeout value is too large
手动安装bravado分支(PR):
pip install "bravado[fido] @ git+https://github.com/tschaume/bravado@9ce06f2df7118e16af4a3d3fdc21ccfeedc5cd50#egg=bravado-11.0.3"
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装软件包的更多信息。
源代码分发
mpcontribs_client-5.8.4.tar.gz (30.4 kB 查看哈希值)