Aids users in publishing data to a Record Evolution Datapod
Project description
reswarm-py
About
Makes publishing data to a Record Evolution Datapod incredibly easy!
Usage
import asyncio
from reswarm import Reswarm
# create a reswarm instance, which auto connects to the Record Evolution Platform
# the reswarm instance handles authentication and reconnects when connection is lost
rw = Reswarm()
async def main():
while True:
# publish an event (if connection is not established the publish is skipped)
publication = await rw.publish("test.publish.com", {"temperature": 20})
print(publication)
await asyncio.sleep(3)
if __name__ == "__main__":
# run the main coroutine
asyncio.get_event_loop().create_task(main())
# run the reswarm component
rw.run()
Options
The Reswarm __init__ function can be configured with the following options:
{
serial_number: string;
}
serial_number: Used to set the serial_number of the device if the DEVICE_SERIAL_NUMBER environment variable does not exist. It can also be used if the user wishes to authenticate as another device.
Advanced Usage
If you need more control, e.g. acting on lifecycle events (onJoin, onLeave) take a look at
the examples folder.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reswarm-0.0.16.tar.gz.
File metadata
- Download URL: reswarm-0.0.16.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e45930e744698f53ea1844518a368493f7bd588ab01593eb888c4ece7cb814a8
|
|
| MD5 |
1368cd946435bed234b9e197368ad84e
|
|
| BLAKE2b-256 |
3265d5ba4b0133e6113f8effe057c548af0bd7f77075a9b6603b762729ecb682
|
File details
Details for the file reswarm-0.0.16-py3-none-any.whl.
File metadata
- Download URL: reswarm-0.0.16-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
448afbc158c52ae5b74877d2fe5093a82e3d5f4415cccc8529dbe58d9bd3a5b0
|
|
| MD5 |
91bc2a51e520711fca61cc7550c05cb3
|
|
| BLAKE2b-256 |
3ec9a6e2546bfa36dcb9309132997123c39a6ca53e53991d40dd3afb1f67db28
|