SDK to integrate your IronFlock Industry 4 Apps with the IronFlock Data Infrastructure
Project description
ironflock
About
With this library you can publish data from your apps on your IoT edge hardware to the fleet data storage of the IronFlock devops platform. When this library is used on a certain device the library automatically uses the private messaging realm (Unified Name Space) of the device's fleet and the data is collected in the respective fleet database.
So if you use the library in your app, the data collection will always be private to the app user's fleet.
For more information on the IronFlock IoT Devops Platform for engineers and developers visit our IronFlock home page.
Requirements
- Python 3.8 or higher
- Compatible with Python 3.8, 3.9, 3.10, 3.11, and 3.12
Installation
Install from PyPI:
pip install ironflock
Usage
import asyncio
from ironflock import IronFlock
# create an IronFlock instance to connect to the IronFlock platform data infrastructure.
# The IronFlock instance handles authentication when run on a device registered in IronFlock.
ironflock = IronFlock()
async def main():
while True:
# publish an event (if connection is not established the publish is skipped)
publication = await ironflock.publish("test.publish.com", {"temperature": 20})
print(publication)
await asyncio.sleep(3)
if __name__ == "__main__":
ironflock = IronFlock(mainFunc=main)
ironflock.run()
Options
The IronFlock __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.
Development
Install the necessary build tools if you don't have them already:
pip install --upgrade build twine
Build and publish a new pypi package:
just publish
Alternatively, you can build manually:
# Clean previous builds
rm -rf build dist *.egg-info
# Build the package
python -m build
# Upload to PyPI
twine upload dist/*
Check the package at https://pypi.org/project/ironflock/.
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 ironflock-1.1.0.tar.gz.
File metadata
- Download URL: ironflock-1.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
237f8de1359d81fccedf84037f46c965c88cc6cd761f0010d867728397314d67
|
|
| MD5 |
28ebb73f25a89a6bfa25ccd350d016ec
|
|
| BLAKE2b-256 |
a67350b34841eef2124cebb3627e39658ed9c5400303269d8d7ce0f0fc56ef8e
|
File details
Details for the file ironflock-1.1.0-py3-none-any.whl.
File metadata
- Download URL: ironflock-1.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab10a08f05758ef012183d7c8dd2dffe75f426548b66e78c149f560014651871
|
|
| MD5 |
a7dd2e8e0e010572f111d36169ce31e2
|
|
| BLAKE2b-256 |
5f813a156e6f804ac7b07eaad851465284c950fd43c81ae9e1f4fe95e1c05d4c
|