Adafruit IO Python
==================

.. image:: https://readthedocs.org/projects/adafruit-io-python-client/badge/?version=latest
    :target: https://adafruit-io-python-client.readthedocs.io/en/latest/
    :alt: Documentation Status

.. image:: https://img.shields.io/discord/327254708534116352.svg
   :target: https://adafru.it/discord
   :alt: Chat

.. image:: https://github.com/adafruit/Adafruit_IO_Python/workflows/Build-CI/badge.svg
    :target: https://github.com/adafruit/Adafruit_IO_Python/actions
    :alt: Build Status

.. image:: https://img.shields.io/badge/Try%20out-Adafruit%20IO%20Python-579ACA.svg?logo=data:image/png;base64, 
   :target: https://mybinder.org/v2/gh/adafruit/adafruit_io_python_jupyter/master?filepath=adafruit-io-python-tutorial.ipynb

.. image:: https://cdn-learn.adafruit.com/assets/assets/000/057/153/original/adafruit_io_iopython.png?1530802073

A Python library and examples for use with `io.adafruit.com <https://io.adafruit.com>`_. 

Compatible with Python Versions 3.6+

Installation
================

Easy Installation
~~~~~~~~~~~~~~~~~
If you have `PIP <https://pip.pypa.io/en/stable/installing/>`_ installed (typically with apt-get install python-pip on a Debian/Ubuntu-based system) then run:

.. code-block:: shell

   pip3 install adafruit-io

This will automatically install the Adafruit IO Python client code for your Python scripts to use. You might want to examine the examples folder in this GitHub repository to see examples of usage.

If the above command fails, you may first need to install prerequisites:

.. code-block:: shell

   pip3 install setuptools
   pip3 install wheel


Manual Installation
~~~~~~~~~~~~~~~~~~~

Clone or download the contents of this repository. Then navigate to the folder in a terminal and run the following command:


.. code-block:: shell

   python setup.py install




Usage 
=====

Documentation for this project is `available on the ReadTheDocs <https://adafruit-io-python-client.readthedocs.io/en/latest/>`_.

Service Integrations
====================

The client includes REST and MQTT helpers for Adafruit IO integrations:

- Time
- Random Data
- Weather (requires IO+ subscription)
- Air Quality (requires IO+ subscription)

Integration API details are documented in ``docs/integrations.rst``.

Service integration examples are included in:

- ``examples/api/weather.py``
- ``examples/api/weather_create_delete.py``
- ``examples/api/air_quality.py``
- ``examples/api/air_quality_create_delete.py``
- ``examples/mqtt/mqtt_weather.py``
- ``examples/mqtt/mqtt_air_quality.py``


Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/CircuitPython_io-client-python/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
