Skip to main content

Pelion Device Management SDK for Python

The mbed-cloud-sdk gives developers access to Pelion Device Management API using Python.

https://img.shields.io/pypi/l/mbed-cloud-sdk.svg https://img.shields.io/pypi/v/mbed-cloud-sdk.svg https://img.shields.io/pypi/pyversions/mbed-cloud-sdk.svg https://img.shields.io/pypi/status/mbed-cloud-sdk.svg https://img.shields.io/circleci/project/github/ARMmbed/mbed-cloud-sdk-python/master.svg?label=circleci https://codecov.io/gh/ARMmbed/mbed-cloud-sdk-python/branch/master/graph/badge.svg

Prerequisites

Python 2.7.10+ / Python 3.4.3, built with SSL support.

Use of virtual environments or pipenv is recommended to manage python versions and dependencies.

Installation

pip install mbed-cloud-sdk

Usage

These instructions can also be found in the official documentation:

  1. Create a configuration file .env in your $HOME or project directory, and add your API key from the portal:

    MBED_CLOUD_SDK_API_KEY="your_api_key_here"
  2. Import the library and you’re ready to go.

    from mbed_cloud.foundation import Device
    
    # List the first 10 devices on your Pelion Device Management account.
    for device in Device().list(max_results=10):
        print("Hello device %s" % device.name)

Documentation and examples

The SDK guide and examples are available at GitHub.

The documentation contains many examples covering various Use Cases that you may have. In each case you can compare the python implementation with alternatives in languages supported by the other Pelion Device Management SDKs.

Contributing

The Pelion Device Management SDK for Python is open source and we would like your help; there is a brief guide on how to get started in CONTRIBUTING.md.

Licence

The Pelion Device Management SDK for Python is free to use and is licensed under the Apache License 2.0. See LICENCE for more information.

Versioning

The current version scheme used by the SDK follows PEP440:

<SDK major>.<SDK minor>.<SDK patch>

Troubleshooting

Suggestions for issues that have been reported when using the SDK.

  • SSL version / SSLV3_ALERT_HANDSHAKE_FAILURE
    urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.mbedcloud.com', port=443):
    Max retries exceeded with url: /v3/firmware-images/
    (Caused by SSLError(SSLError(1, u'[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)'),))

    This probably means the Python interpreter being used has an old version of SSL. The recommended minimum version for the SDK is 1.0.2, however security best practice is to use the latest available version of SSL, which can be found here: https://www.openssl.org. It is recommended to upgrade/rebuild the Python interpreter with the latest available SSL library. The SSL version currently in use by the Python interpreter can be found using python -c "import ssl; print(ssl.OPENSSL_VERSION)"

Release files for mbed-cloud-sdk 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mbed-cloud-sdk 2.2.0
File Interpreter ABI Platform
mbed_cloud_sdk-2.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / mbed_cloud_sdk-2.2.0-py2.py3-none-any.whl

Download URL mbed_cloud_sdk-2.2.0-py2.py3-none-any.whl
Size 973.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
75c4137745e38939b21606b1bc2706d935a24543a0ae8662c97e066a02bedab0
BLAKE2b-256 checksum
How to use checksums
42cb616171db4aa65f54d0839bff70293b8570e5d796c09040a52762ec7918a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page