or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

dashboards.mddevices.mdindex.mdlora.mdproperties.mdseries.mdthings.md
tile.json

tessl/pypi-arduino-iot-client

Arduino IoT Cloud API Python Client for managing devices, things, properties, and timeseries data

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/arduino-iot-client@3.0.x

To install, run

npx @tessl/cli install tessl/pypi-arduino-iot-client@3.0.0

index.mddocs/

Arduino IoT Client

A comprehensive Python client library for the Arduino IoT Cloud API, enabling developers to programmatically manage Arduino IoT devices, things, properties, and timeseries data. The library provides a complete set of API endpoints for device management, thing management, property handling, dashboard operations, and LoRa device support with OAuth2 authentication.

Package Information

  • Package Name: arduino-iot-client
  • Language: Python
  • Installation: pip install arduino-iot-client
  • Requires: Python 3.10+

Core Imports

import iot_api_client as iot
from iot_api_client.configuration import Configuration
from iot_api_client.api import DevicesV2Api, ThingsV2Api, PropertiesV2Api
from iot_api_client.models import *
from iot_api_client.exceptions import ApiException

Basic Usage

import iot_api_client as iot
from iot_api_client.configuration import Configuration
from iot_api_client.api import DevicesV2Api
from iot_api_client.exceptions import ApiException

# Configure OAuth2 authentication
client_config = Configuration(host="https://api2.arduino.cc")
client_config.access_token = "YOUR_ACCESS_TOKEN"

# Create API client
client = iot.ApiClient(client_config)

# Initialize device API
devices_api = DevicesV2Api(client)

try:
    # List all devices
    devices = devices_api.devices_v2_list()
    for device in devices:
        print(f"{device.name} - id: {device.id} - type: {device.type}")

except ApiException as e:
    print(f"API Error: {e}")

For organization access, specify organization ID:

# At client level
client = iot.ApiClient(client_config, header_name="X-Organization", header_value="org_id")

# Or at method level
devices = devices_api.devices_v2_list(x_organization="org_id")

Architecture

The Arduino IoT Client follows a resource-based API structure:

  • API Classes: 14 specialized API classes handling different resource types
  • Models: 87 Pydantic-based model classes for data validation and serialization
  • Core Infrastructure: Configuration, authentication, and error handling components
  • OAuth2 Authentication: Secure access with organization-level permissions

The library is auto-generated from OpenAPI specifications, ensuring consistency with the Arduino IoT Cloud API.

Capabilities

Device Management

Complete lifecycle management of Arduino IoT devices including creation, configuration, certificate management, OTA updates, and password handling.

class DevicesV2Api:
    def devices_v2_create(self, create_devices_v2_payload, x_organization=None) -> ArduinoDevicev2: ...
    def devices_v2_list(self, across_user_ids=None, serial=None, tags=None, x_organization=None) -> List[ArduinoDevicev2]: ...
    def devices_v2_show(self, id, x_organization=None) -> ArduinoDevicev2: ...
    def devices_v2_update(self, id, devicev2, x_organization=None) -> ArduinoDevicev2: ...
    def devices_v2_delete(self, id, x_organization=None) -> None: ...

Device Management

Thing Management

Management of IoT things including creation, cloning, sketch generation, and template operations.

class ThingsV2Api:
    def things_v2_create(self, thing_create, force=None, x_organization=None) -> ArduinoThing: ...
    def things_v2_list(self, across_user_ids=None, device_id=None, ids=None, tags=None, x_organization=None) -> List[ArduinoThing]: ...
    def things_v2_clone(self, id, thing_clone, x_organization=None) -> ArduinoThing: ...
    def things_v2_create_sketch(self, id, thing_sketch=None, x_organization=None) -> ArduinoThing: ...
    def things_v2_delete(self, id, x_organization=None) -> None: ...

Thing Management

Property Management

Real-time and historical property data management with timeseries support and property type discovery.

class PropertiesV2Api:
    def properties_v2_create(self, id, model_property, x_organization=None) -> ArduinoProperty: ...
    def properties_v2_list(self, id, show_deleted=None, x_organization=None) -> List[ArduinoProperty]: ...
    def properties_v2_publish(self, id, pid, property_value, x_organization=None) -> None: ...
    def properties_v2_timeseries(self, id, pid, desc=None, start=None, end=None, interval=None, x_organization=None) -> ArduinoSeriesResponse: ...
    def properties_v2_update(self, id, pid, model_property, x_organization=None) -> ArduinoProperty: ...

class PropertyTypesV1Api:
    def property_types_v1_list_types(self) -> List[ArduinoPropertytype]: ...

Property Management

Dashboard Operations

Dashboard creation, sharing, widget linking, and template management.

class DashboardsV2Api:
    def dashboards_v2_create(self, dashboardv2, x_organization=None) -> ArduinoDashboardv2: ...
    def dashboards_v2_list(self, x_organization=None) -> List[ArduinoDashboardv2]: ...
    def dashboards_v2_clone(self, dashboard_id, x_organization=None) -> ArduinoDashboardv2: ...
    def dashboards_v2_share(self, id, sharerequest, x_organization=None) -> None: ...
    def dashboards_v2_link(self, id, widget_id, widgetlink, x_organization=None) -> None: ...

Dashboard Operations

Timeseries Data

Advanced querying capabilities for timeseries data with batch operations and historical data access.

class SeriesV2Api:
    def series_v2_batch_query_raw(self, batch_query_raw_requests_media_v1, x_organization=None) -> ArduinoSeriesRawResponse: ...
    def series_v2_batch_query_sampling(self, batch_query_sampled_requests_media_v1, x_organization=None) -> ArduinoSeriesSampledResponse: ...
    def series_v2_batch_query_raw_last_value(self, batch_last_value_requests_media_v1, x_organization=None) -> ArduinoSeriesRawLastValueResponse: ...
    def series_v2_historic_data(self, historic_data_request, x_organization=None) -> ArduinoSeriesResponse: ...

Timeseries Data

LoRa Connectivity

LoRa device management and frequency plan configuration for long-range IoT applications.

class LoraDevicesV1Api:
    def lora_devices_v1_create(self, create_lora_devices_v1_payload, x_organization=None) -> ArduinoLoradevicev1: ...
    def lora_devices_v1_list(self, x_organization=None) -> List[ArduinoLoradevicev1]: ...
    def lora_devices_v1_show(self, id, x_organization=None) -> ArduinoLoradevicev1: ...

class LoraFreqPlanV1Api:
    def lora_freq_plan_v1_list(self, x_organization=None) -> List[ArduinoLorafreqplanv1]: ...

LoRa Connectivity

Authentication

OAuth2 authentication with Arduino IoT Cloud API:

class Configuration:
    def __init__(self, host="https://api2.arduino.cc", access_token=None, **kwargs): ...

    # Properties
    host: str
    access_token: str
    api_key: Dict[str, str]
    username: str
    password: str
    client_side_validation: bool

Error Handling

Comprehensive exception hierarchy for robust error handling:

class ApiException(Exception): ...
class BadRequestException(ApiException): ...  # HTTP 400
class UnauthorizedException(ApiException): ...  # HTTP 401
class ForbiddenException(ApiException): ...  # HTTP 403
class NotFoundException(ApiException): ...  # HTTP 404
class ServiceException(ApiException): ...  # HTTP 5xx

Core Types

class ApiClient:
    def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None): ...

class ApiResponse:
    status_code: int
    headers: Dict[str, str]
    data: Any
    raw_data: bytes