Python lib for sending sensor data to Consentium IoT server.
Project description
ConsentiumThings Python API Documentation
Overview
ConsentiumThings is a Python API designed to facilitate sending and receiving data to and from Consentium Cloud. It provides an easy-to-use interface for developers to interact with Consentium Cloud services programmatically.
Installation
You can install ConsentiumThings via pip:
pip install consentiumthings
Usage
Importing ConsentiumThings
from consentiumthings import consentiumthings
Initializing ConsentiumThings
To initialize ConsentiumThings, you need to provide your board key.
ct = consentiumthings("board_key")
Sending Data
To send data to Consentium Cloud, use the begin_send()
method followed by send_data()
.
ct.begin_send("send_key")
ct.send_data([1, 2, 3, 4], ['info1', 'info2', 'info3'])
Receiving Data
To receive data from Consentium Cloud, use the begin_receive()
method followed by receive_data()
.
ct.begin_receive("receive_key", recent=False)
print(ct.receive_data())
Methods
consentiumthings(board_key)
- Parameters:
board_key
(str): The key associated with the board.
begin_send(send_key)
- Parameters:
send_key
(str): The key associated with the send operation.
send_data(data, info_list)
- Parameters:
data
(list): The data to be sent.info_list
(list): List of information associated with each data item.
begin_receive(receive_key, recent=False)
- Parameters:
receive_key
(str): The key associated with the receive operation.recent
(bool, optional): If True, only the most recent data will be received. Default is False.
receive_data()
- Returns:
- List of received data.
Example
from consentiumthings import consentiumthings
# Initialize ConsentiumThings
ct = consentiumthings("board_key")
# Send data
ct.begin_send("send_key")
ct.send_data([1, 2, 3, 4], ['info1', 'info2', 'info3'])
# Receive data
ct.begin_receive("receive_key", recent=False)
print(ct.receive_data())
Support
For any issues or questions regarding ConsentiumThings Python API, please contact consentium.inc@gmail.com.
License
This software is licensed under the MIT License. See the LICENSE file for details.
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
Built Distribution
File details
Details for the file consentiumthings-0.5.tar.gz
.
File metadata
- Download URL: consentiumthings-0.5.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f153d61deec0c1395dc8b3d328ee6690677ef2e4859d255474a635d8e61421f |
|
MD5 | 13b27c0cfe874729e39c27df637ca683 |
|
BLAKE2b-256 | 02db6780f4794259695aada9f60b385a9e4cf1dcd3098762f485ca476b1e7846 |
File details
Details for the file consentiumthings-0.5-py3-none-any.whl
.
File metadata
- Download URL: consentiumthings-0.5-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ce39ad5335b51d741a41aa795131a87022aba615ace75cf768ab03e2602b9aa |
|
MD5 | 93747eab251f2f314fd88df479743836 |
|
BLAKE2b-256 | e9b58ff8e8781492530edfec147984611cb675690f0237b71527ef8ba601c59c |