Skip to main content

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.

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 components if you don't have them already:

pip install --upgrade setuptools wheel twine

Build and publish a new pypi package:

make publish

Check the package at https://pypi.org/project/ironflock/.

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

ironflock-1.0.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ironflock-1.0.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file ironflock-1.0.2.tar.gz.

File metadata

  • Download URL: ironflock-1.0.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for ironflock-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2dc1e6fdf14d7caf035e281f40af02d8272e4b784c8a03cf962cffe06d1b362d
MD5 3aeb9918883f24a78ae257f14ada264c
BLAKE2b-256 babe39d16feeead31691221bc04ead0aa0ddeff2be7a6fd7b039333300bebdf3

See more details on using hashes here.

File details

Details for the file ironflock-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ironflock-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for ironflock-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a6393deb70e7bc9978132c3649768d01eb78b54d60b3b64cbf44a658b4c1639
MD5 03b4389392de1a011bf1becd6de19903
BLAKE2b-256 f6fc451292ebd0a2aebe025f05bca4a419d8e9c27872ef89584735f2162a2575

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page