Metadata-Version: 2.0
Name: andonapp
Version: 1.0.0
Summary: Python client for communicating with Andon.
Home-page: https://github.com/andonapp/andonapp-python
Author: Peter Winckles
Author-email: admin@andonapp.com
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Requires-Dist: requests


**********************
AndonApp Python Client
**********************

Python client library for reporting data to `Andon <https://www.andonapp.com/>`_

=======
Install
=======

.. code-block::

    pip install andonapp

=====
Usage
=====

In order to programmatically connect to Andon's APIs you must first generate an API token. This is done by logging into your Andon account, navigating to the `API settings page <https://portal.andonapp.com/settings/tokens>`_, and generating a new token.  Make sure to record the token, and keep it secret.

Reference Andon's `getting started guide <https://drive.google.com/file/d/0B5cQI3VvgCT8UllmaENIazlwbGc/view>`_ and `API guide <https://drive.google.com/file/d/0B5cQI3VvgCT8enNIZGN2QVo0STg/view>`_ for complete details on these prerequisites

Setting up the Client
=====================

Now that you have a token, create a client as follows:

.. code-block:: python

    from andonapp import AndonAppClient

    client = AndonAppClient(org_name, api_token)

Reporting Data
==============

Here's an example of using the client to report a success:

.. code-block:: python

    client.report_data(
        line_name='line 1',
        station_name='station 1',
        pass_result='PASS',
        process_time_seconds=100)

And a failure:

.. code-block:: python

    client.report_data(
        line_name='line 1',
        station_name='station 1',
        pass_result='FAIL',
        process_time_seconds=100,
        fail_reason='Test Failure',
        fail_notes='notes')

Updating a Station Status
=========================

Here's an example of flipping a station to Red:

.. code-block:: python

    client.update_station_status(
        line_name='line 1',
        station_name='station 1',
        status_color='RED',
        status_reason='Missing parts',
        status_notes='notes')

And back to Green:

.. code-block:: python

    client.update_station_status(
        line_name='line 1',
        station_name='station 1',
        status_color='GREEN')

=======
License
=======

`Licensed under the MIT license <LICENSE>`_.


