Skip to main content

A Python Library to simplify connection to Antares IoT Platform

Project description

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](https://antares.id).

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

antares-http-1.1.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

antares_http-1.1.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file antares-http-1.1.2.tar.gz.

File metadata

  • Download URL: antares-http-1.1.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for antares-http-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1c5e9bc2744ea81e793fcca81732d40f69a1bafda1479f6332d6deac53e1fe2e
MD5 b602bb434d0133d87d258fbcce1ffb8a
BLAKE2b-256 ea93df1fa0ee549a407b14ce655600d38b6f0ea011cde824e2c1e3bda2d1401d

See more details on using hashes here.

File details

Details for the file antares_http-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: antares_http-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for antares_http-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a40d00c19829cd4ed24a3056c96fcc7db6c0e2eb52a18387c479848b2adac16e
MD5 62d49fed5e3ff818cf6b21f9f1e4d0bb
BLAKE2b-256 7b817007fa36ece128966815d05e1d1bc559b2fbb4b404ef8b0b05896b3795c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page