Перейти к файлу
Marina Samuel 43af563b61 Updating urllib3 versions. 2019-05-14 15:43:46 -04:00
redash_client Review comments (#95). 2019-05-14 15:40:20 -04:00
.flake8 Lint ActivityStreamExperimentDashboard. 2017-04-20 14:40:46 -04:00
.gitignore Allow more flexibility with axis information when creating a visualization. 2019-02-08 11:37:15 -05:00
.travis.yml Closes #61: Update requirements, travis, and Makefile accordingly. 2018-02-05 14:58:11 -05:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct file 2019-03-29 23:07:50 -07:00
LICENSE First commit. Minimal API functionality. 2017-03-27 18:03:35 -04:00
Makefile Closes #61: Update requirements, travis, and Makefile accordingly. 2018-02-05 14:58:11 -05:00
README.rst Release wheel 2018-10-22 16:45:57 -04:00
lambda.sh Rename redash_client.py to client.py and src to redash_client. 2017-08-16 16:08:02 -04:00
requirements.txt Updating urllib3 versions. 2019-05-14 15:43:46 -04:00
setup.cfg Convert README from .md to .rst to work in pypi. 2017-08-16 16:08:02 -04:00
setup.py Updating urllib3 versions. 2019-05-14 15:43:46 -04:00
test_requirements.txt Updating urllib3 versions. 2019-05-14 15:43:46 -04:00

README.rst

.. image:: https://travis-ci.org/mozilla/redash_client.svg?branch=master
  :target: https://travis-ci.org/mozilla/redash_client

.. image:: https://coveralls.io/repos/github/mozilla/redash_client/badge.svg?branch=master
  :target: https://coveralls.io/github/mozilla/redash_client?branch=master

====================
Redash Python Client
====================

A client for the Redash API for stmo (https://sql.telemetry.mozilla.org)

=======
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
===============

First, you must update the :code:`version` field in :code:`setup.py`.
Then run this commands:

.. code-block:: bash

  python setup.py sdist bdist_wheel
  twine upload dist/*

Make sure you have ``wheel`` and ``twine`` installed.