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.
You can install ConsentiumThings via pip:
pip install consentiumthings
from consentiumthings import consentiumthings
To initialize ConsentiumThings, you need to provide your board key.
ct = consentiumthings("board_key")
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'])
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())
- Parameters:
board_key
(str): The key associated with the board.
- Parameters:
send_key
(str): The key associated with the send operation.
- Parameters:
data
(list): The data to be sent.info_list
(list): List of information associated with each data item.
- 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.
- Returns:
- List of received data.
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())
For any issues or questions regarding ConsentiumThings Python API, please contact [email protected].
This software is licensed under the MIT License. See the LICENSE file for details.