Python 3 library for connecting to WolkAbout IoT Platform
Project description
```sh
██╗ ██╗ ██████╗ ██╗ ██╗ ██╗ ██████╗ ██████╗ ███╗ ██╗███╗ ██╗███████╗ ██████╗████████╗
██║ ██║██╔═══██╗██║ ██║ ██╔╝██╔════╝██╔═══██╗████╗ ██║████╗ ██║██╔════╝██╔════╝╚══██╔══╝
██║ █╗ ██║██║ ██║██║ █████╔╝ ██║ ██║ ██║██╔██╗ ██║██╔██╗ ██║█████╗ ██║ ██║
██║███╗██║██║ ██║██║ ██╔═██╗ ██║ ██║ ██║██║╚██╗██║██║╚██╗██║██╔══╝ ██║ ██║
╚███╔███╔╝╚██████╔╝███████╗██║ ██╗╚██████╗╚██████╔╝██║ ╚████║██║ ╚████║███████╗╚██████╗ ██║
╚══╝╚══╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═╝
██████╗ ██╗ ██╗████████╗██╗ ██╗ ██████╗ ███╗ ██╗
██╔══██╗╚██╗ ██╔╝╚══██╔══╝██║ ██║██╔═══██╗████╗ ██║
█████╗██████╔╝ ╚████╔╝ ██║ ███████║██║ ██║██╔██╗ ██║
╚════╝██╔═══╝ ╚██╔╝ ██║ ██╔══██║██║ ██║██║╚██╗██║
██║ ██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
```
----
WolkAbout Python Connector library for connecting devices to [WolkAbout IoT Platform](https://demo.wolkabout.com/#/login).
Supported device communication protocol(s):
* JsonSingleReferenceProtocol
## Prerequisite
* Python 3
## Installation
```sh
pip3 install wolk-connect
```
### Installing from source
This repository must be cloned from the command line using:
```sh
git clone --recurse-submodules https://github.com/Wolkabout/WolkConnect-Python.git
```
Install dependencies by invoking `pip3 install -r requirements.txt`
Install the package by running:
```python
py setup.py install
```
## Example Usage
### Establishing connection with WolkAbout IoT platform
Create a device on WolkAbout IoT platform by importing [Simple-example-deviceTemplate.json](https://github.com/Wolkabout/WolkConnect-Python/blob/master/examples/simple/Simple-example-deviceTemplate.json).<br />
This template fits [wolk_example.py](https://github.com/Wolkabout/WolkConnect-Python/blob/master/examples/simple/wolk_example.py) and demonstrates the sending of a temperature sensor reading.
```python
import wolk
# Setup the device credentials which you received
# when the device was created on the platform
device = wolk.Device(
key="device_key",
password="some_password"
)
# Pass your device and server information
# defaults to secure connection to Demo instance
wolk_device = wolk.WolkConnect(
device,
host="api-demo.wolkabout.com",
port=8883,
ca_cert="path/to/ca.crt"
)
wolk_device.connect()
```
### Adding sensor readings
```python
wolk_device.add_sensor_reading("T", 26.93)
```
### Data publish strategy
Stored sensor readings are pushed to WolkAbout IoT platform on demand by calling:
```python
wolk_device.publish()
```
### Disconnecting from the platform
```python
wolk_device.disconnect()
```
## Additional functionality
WolkConnect-Python library has integrated additional features which can perform full WolkAbout IoT platform potential. Read more about full feature set example [HERE](https://github.com/Wolkabout/WolkConnect-Python/tree/master/examples/full_feature_set).
██╗ ██╗ ██████╗ ██╗ ██╗ ██╗ ██████╗ ██████╗ ███╗ ██╗███╗ ██╗███████╗ ██████╗████████╗
██║ ██║██╔═══██╗██║ ██║ ██╔╝██╔════╝██╔═══██╗████╗ ██║████╗ ██║██╔════╝██╔════╝╚══██╔══╝
██║ █╗ ██║██║ ██║██║ █████╔╝ ██║ ██║ ██║██╔██╗ ██║██╔██╗ ██║█████╗ ██║ ██║
██║███╗██║██║ ██║██║ ██╔═██╗ ██║ ██║ ██║██║╚██╗██║██║╚██╗██║██╔══╝ ██║ ██║
╚███╔███╔╝╚██████╔╝███████╗██║ ██╗╚██████╗╚██████╔╝██║ ╚████║██║ ╚████║███████╗╚██████╗ ██║
╚══╝╚══╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═╝
██████╗ ██╗ ██╗████████╗██╗ ██╗ ██████╗ ███╗ ██╗
██╔══██╗╚██╗ ██╔╝╚══██╔══╝██║ ██║██╔═══██╗████╗ ██║
█████╗██████╔╝ ╚████╔╝ ██║ ███████║██║ ██║██╔██╗ ██║
╚════╝██╔═══╝ ╚██╔╝ ██║ ██╔══██║██║ ██║██║╚██╗██║
██║ ██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
```
----
WolkAbout Python Connector library for connecting devices to [WolkAbout IoT Platform](https://demo.wolkabout.com/#/login).
Supported device communication protocol(s):
* JsonSingleReferenceProtocol
## Prerequisite
* Python 3
## Installation
```sh
pip3 install wolk-connect
```
### Installing from source
This repository must be cloned from the command line using:
```sh
git clone --recurse-submodules https://github.com/Wolkabout/WolkConnect-Python.git
```
Install dependencies by invoking `pip3 install -r requirements.txt`
Install the package by running:
```python
py setup.py install
```
## Example Usage
### Establishing connection with WolkAbout IoT platform
Create a device on WolkAbout IoT platform by importing [Simple-example-deviceTemplate.json](https://github.com/Wolkabout/WolkConnect-Python/blob/master/examples/simple/Simple-example-deviceTemplate.json).<br />
This template fits [wolk_example.py](https://github.com/Wolkabout/WolkConnect-Python/blob/master/examples/simple/wolk_example.py) and demonstrates the sending of a temperature sensor reading.
```python
import wolk
# Setup the device credentials which you received
# when the device was created on the platform
device = wolk.Device(
key="device_key",
password="some_password"
)
# Pass your device and server information
# defaults to secure connection to Demo instance
wolk_device = wolk.WolkConnect(
device,
host="api-demo.wolkabout.com",
port=8883,
ca_cert="path/to/ca.crt"
)
wolk_device.connect()
```
### Adding sensor readings
```python
wolk_device.add_sensor_reading("T", 26.93)
```
### Data publish strategy
Stored sensor readings are pushed to WolkAbout IoT platform on demand by calling:
```python
wolk_device.publish()
```
### Disconnecting from the platform
```python
wolk_device.disconnect()
```
## Additional functionality
WolkConnect-Python library has integrated additional features which can perform full WolkAbout IoT platform potential. Read more about full feature set example [HERE](https://github.com/Wolkabout/WolkConnect-Python/tree/master/examples/full_feature_set).
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
wolk-connect-3.1.3.tar.gz
(33.2 kB
view hashes)
Built Distribution
Close
Hashes for wolk_connect-3.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db6c2604c7bfb02be3ffc219c13c75732997a39a7928213519ecc13053d826cb |
|
MD5 | 926368e66a74d611ce9b9c1354ed0edf |
|
BLAKE2b-256 | 290e2aeb7b4cfbe05dd660fd43dcd0bae8c0ee5739769d60cd5da98a03d995b3 |