python iot平台,antares-http-简化与Antares IoT平台连接的Python库-Antares Support Team Installation...

作者:Antares Support Team

### 作者邮箱:support@antares.id

### 首页:https://github.com/antaresdocumentation/antares-python

### 文档:None

### 下载链接

# Antares Python

up-238e77af49714af4f7c02d4b23dd29ae.jpg

b5e7ad14f7ef51c4d0085b45349d791a.png

This is a Python library to simplify the connection to Antares IoT Platform. For more information about the platform itself, please visit the

up-5a7a0f33bb1cf9e839c6ca8911a4cff0.jpg.

Installation

Make sure you have Python (2 or 3) and pip installed.

pip install antares-http

Usage Example

Send data

from antares_http import antares

antares.setDebug(True)

antares.setAccessKey('your-access-key')

myData = {

'temp' : 77,

'windsp' : 10

}

antares.send(myData, 'your-project-name', 'your-device-name')

Get latest data

from antares_http import antares

antares.setDebug(False)

antares.setAccessKey('your-access-key')

latestData = antares.get('your-project-name', 'your-device-name')

print(latestData['content'])

API Reference

setAccessKey(access-key)

Set the access-key parameter to your Antares access key.

setDebug(status)

Set whether you want to show debug results of every HTTP request to Antares or not, can be set to True or False.

get(projectName, deviceName)

Get the latest data from your Antares device.

return: latest data (json)

getAll(projectName, deviceName, limit=integer)

Get a chunk of data from your Antares project, you can set the limitation by setting the limit parameter.

return: Chunk of data from your Antares device

getAllId(projectName, deviceName, limit=integer)

Get a chunk of data IDs from your Antares project, you can set the limitation by setting the limit parameter.

return: Chunk of data IDs from your Antares device

getSpecific(projectName, deviceName, data-id)

Get specific data from your Antares device, the data-id parameter looks like this: cin_81723819.

return: Specific device data

getDeviceId(projectName, deviceName)

Get your Antares device ID.

return: antares device ID (i.e. cnt-44637281)

send(data, projectName, deviceName)

Send data to your Antares project. This can be a python dictionary or string.

return: POST response data from Antares

sendById(data, device-id)

Send data to your Antares device through Antares device ID which looks like cnt-281727372

return: POST response data from Antares

createDevice(projectName, newDeviceName)

Create an Antares device in your Project.

return: device creation response

getDevices(projectName)

Get all device names of Antares project

return: antares device names

Copy from pypi.org

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值