用于stmo的redash api的客户端(https://sql.telemetry.mozilla.org)
redash-client的Python项目详细描述
redash python客户端
stmo的redash api的客户端(https://sql.telemetry.mozilla.org)
安装
pip install redash_client
用法
在使用RedashClient
之前,请将REDASH_API_KEY
环境变量设置为redash api键:
export REDASH_API_KEY=<your_api_key>
导入并使用RedashClient
:
importosfromredash_client.clientimportRedashClientapi_key=os.environ["REDASH_API_KEY"]redash_client=RedashClient(api_key)# Make a Redash API call:redash_client.search_queries("AS Template:")
PIP包装
首先,必须更新setup.py
中的version
字段。
然后运行以下命令:
python setup.py sdist bdist_wheel twine upload dist/*
确保已安装wheel和twine。