Skip to content

allthingstalk/python-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-sdk

PyPI

AllThingsTalk Python SDK provides Python APIs to manage and implement AllThingsTalk devices.

System Requirements

AllThingsTalk Python SDK is a Python 3 library, so make sure you have Python 3 installed. Python 2 won’t work.

Installation

Using pip

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.

From source code

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 .

On a Raspberry PI

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.

Examples

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.

Documentation

https://allthingstalk.github.io/python-sdk/

License

Apache 2.0

Contributions

Pull requests and new issues are welcome.