AllThingsTalk Python SDK provides Python APIs to manage and implement AllThingsTalk devices.
AllThingsTalk Python SDK is a Python 3 library, so make sure you have Python 3 installed. Python 2 won’t work.
The SDK is available on PyPI, and can be installed using pip3
. If you don't have pip3
or python3
installed, please follow the Python Installation Tutorial.
pip3 install allthingstalk
We recommend that you install the SDK inside a Python Virtual Enviroment. In case you wish to install the package globally, you will probably need to prefix the command with sudo
.
It's also possible to install AllThingsTalk Python SDK from source code.
You can either clone the public repository:
git clone git://github.com/allthingstalk/python-sdk.git
Or, download the tarball:
curl -OL https://github.com/allthingstalk/requests/tarball/master
To install the package, use:
cd python-sdk
pip3 install .
One of primary use cases for the AllThingsTalk Python SDK is embedded development on Linux devices, and Raspberry PI is among the most popular embedded Linux platforms.
To install the SDK, you can use any of the methods above. Whichever method you choose, we recommend executing it globally as a super user - sudo pip3 install allthingstalk
.
To see how to integrate the SDK with Grove PI sensors, please take a look at Using AllThingsTalk SDK with GrovePi.
To obtain examples you can either clone the repository as described above, or copy the examples directly from GitHub.
Counter is one of the most basic examples. Copy it to your hard drive, and replace DEVICE_TOKEN
and DEVICE_ID
with those obtained from Maker. If you have installed the SDK correctly, you should be able to run the example with python3 counter.py
. The example will create one asset and increment it from 0
to 9
with second long delays. You can use Maker to monitor the progress.
https://allthingstalk.github.io/python-sdk/
Apache 2.0
Pull requests and new issues are welcome.