Skip to main content

Microsoft Azure IoT Device Library

Project description

Azure IoT Device SDK

The Azure IoT Device SDK for Python provides functionality for communicating with the Azure IoT Hub for both Devices and Modules.

Azure IoT Device Features

The SDK provides the following clients:

  • Provisioning Device Client

    • Creates a device identity on the Azure IoT Hub
  • IoT Hub Device Client

    • Send telemetry messages to Azure IoT Hub
    • Receive Cloud-to-Device (C2D) messages from the Azure IoT Hub
    • Receive and respond to direct method invocations from the Azure IoT Hub
  • IoT Hub Module Client

    • Supports Azure IoT Edge Hub and Azure IoT Hub
    • Send telemetry messages to a Hub or to another Module
    • Receive Input messages from a Hub or other Modules
    • Receive and respond to direct method invocations from a Hub or other Modules

These clients are available with an asynchronous API, as well as a blocking synchronous API for compatibility scenarios. We recommend you use Python 3.7+ and the asynchronous API.

Python Version Asynchronous API Synchronous API
Python 3.5.3+ YES YES
Python 2.7 NO YES


pip install azure-iot-device

Device Samples

Check out the samples repository for example code showing how the SDK can be used in a variety of scenarios, including:

  • Sending multiple telemetry messages at once.
  • Receiving Cloud-to-Device messages.
  • Using Edge Modules with the Azure IoT Edge Hub.
  • Send and receive updates to device twin
  • Receive invocations to direct methods
  • Register a device with the Device Provisioning Service

Getting help and finding API docs

API documentation for this package is available via Microsoft Docs

Additionally, the SDK makes use of docstrings which means you can find API documentation directly through Python with use of the help command:


>>> from azure.iot.device import IoTHubDeviceClient
>>> help(IoTHubDeviceClient)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for azure-iot-device, version 2.7.1
Filename, size File type Python version Upload date Hashes
Filename, size azure_iot_device-2.7.1-py2.py3-none-any.whl (163.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size azure-iot-device-2.7.1.tar.gz (123.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page