A Python Library to simplify connection to Antares IoT Platform
Project description
Antares Python
Antares Python
This is a Python library to simplify the connection to Antares IoT Platform. For more information about the platform itself, please visit the official site.
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 theaccess-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 toTrue
orFalse
. -
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 thelimit
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 thelimit
parameter.
return: Chunk of data IDs from your Antares device -
getSpecific(projectName, deviceName, data-id)
Get specific data from your Antares device, thedata-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 likecnt-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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for antares_http-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd140f609c0fdbcb2aa54dedd21f9b71ad098b5da4c2d77c699108b57c1f104d |
|
MD5 | b861ed50bc7eb0b69c6b95466bf360c6 |
|
BLAKE2b-256 | f5194fed81c81ace27ccb88940cb98b0504c792519b6211dcdab3b9c92538c28 |