2017-08-16 23:20:24 +03:00
|
|
|
.. image:: https://travis-ci.org/mozilla/redash_client.svg?branch=master
|
|
|
|
:target: https://travis-ci.org/mozilla/redash_client
|
2017-08-16 17:21:47 +03:00
|
|
|
|
2017-08-16 23:20:24 +03:00
|
|
|
.. image:: https://coveralls.io/repos/github/mozilla/redash_client/badge.svg?branch=master
|
|
|
|
:target: https://coveralls.io/github/mozilla/redash_client?branch=master
|
2017-08-16 17:21:47 +03:00
|
|
|
|
|
|
|
====================
|
|
|
|
Redash Python Client
|
|
|
|
====================
|
|
|
|
|
2018-05-11 16:52:42 +03:00
|
|
|
A client for the Redash API for stmo (https://sql.telemetry.mozilla.org)
|
2017-08-16 23:20:24 +03:00
|
|
|
|
|
|
|
=======
|
|
|
|
Install
|
|
|
|
=======
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
pip install redash_client
|
|
|
|
|
|
|
|
=====
|
|
|
|
Usage
|
|
|
|
=====
|
|
|
|
|
|
|
|
Before using :code:`RedashClient`, set the :code:`REDASH_API_KEY` environment variable to your Redash API key:
|
|
|
|
|
|
|
|
:code:`export REDASH_API_KEY=<your_api_key>`
|
|
|
|
|
|
|
|
To import and use :code:`RedashClient`:
|
|
|
|
|
|
|
|
.. code:: python
|
|
|
|
|
|
|
|
import os
|
|
|
|
from redash_client.client import RedashClient
|
|
|
|
|
|
|
|
api_key = os.environ["REDASH_API_KEY"]
|
|
|
|
redash_client = RedashClient(api_key)
|
|
|
|
|
|
|
|
# Make a Redash API call:
|
|
|
|
redash_client.search_queries("AS Template:")
|
|
|
|
|
|
|
|
|
|
|
|
===============
|
|
|
|
Package for Pip
|
|
|
|
===============
|
|
|
|
|
2018-10-22 22:33:18 +03:00
|
|
|
First, you must update the :code:`version` field in :code:`setup.py`.
|
|
|
|
Then run this commands:
|
2017-08-22 19:13:14 +03:00
|
|
|
|
2017-08-16 23:20:24 +03:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2018-10-22 22:33:18 +03:00
|
|
|
python setup.py sdist bdist_wheel
|
|
|
|
twine upload dist/*
|
2017-08-16 23:20:24 +03:00
|
|
|
|
2018-10-22 22:33:18 +03:00
|
|
|
Make sure you have ``wheel`` and ``twine`` installed.
|