Git Product home page Git Product logo

mbed-cloud-sdk-python's Introduction

Mbed Cloud SDK for Python

The mbed-cloud-sdk gives developers access to the full Mbed Cloud suite using Python.

https://circleci.com/gh/ARMmbed/mbed-cloud-sdk-python/tree/master.svg?style=shield&circle-token=ec05043ded945f81984e7fd2fce23fe793e7b634

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 an API key in the Mbed Cloud Portal.

  2. Create a configuration file in your $HOME or project directory (.mbed_cloud_config.json):

    {
        "api_key": "your_api_key_here"
    }
  3. Import the library and you're ready to go.

    from mbed_cloud import ConnectAPI
    connect_api = ConnectAPI()
    connect_api.list_connected_devices().data[0]
    {
      "id": "Device #1",
      "state": "unenrolled",
      ...
    }
    from mbed_cloud import AccountManagementAPI
    api = AccountManagementAPI()
    list(api.list_users())[0]
    {
      "email": "[email protected]",
      "full_name": "A.N. Individual",
      ...
    }

Documentation and examples

The full documentation and API reference is hosted here: https://cloud.mbed.com/docs/v1.2/mbed-cloud-sdk-python/.

See the examples directory for a collection of use-cases of this API, e.g.:

python examples/connect/list-connected-devices.py

Contributing

Mbed Cloud 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

Mbed Cloud SDK for Python is free to use and licensed under the Apache License 2.0. See LICENCE for more information.

Versioning

The current version scheme used by the SDK reflects the version of the API it abstracts, and otherwise follows PEP440:

<API major>.<API minor>.<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.us-east-1.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)"

mbed-cloud-sdk-python's People

Contributors

davidhyman avatar arekzaluski avatar hermansc avatar monty-bot avatar madchutney avatar acabarbaye avatar tommilaivamaa avatar thegecko avatar fheathco avatar bremoran avatar mbartling avatar tubaman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.