Skip to main content

Publishing data to a IronFlock Fleet Storage

Project description

ironflock

About

With this library you can publishing data to IronFlock fleet storage. 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.

Usage

import asyncio
from ironflock import IronFlock

# create a ironflock instance, which auto connects to the IronFlock Platform
# the ironflock instance handles authentication and reconnects when the connection is lost
rw = IronFlock()

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 ironflock component
    rw.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:

python setup.py sdist bdist_wheel
twine upload dist/*

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.0.tar.gz (5.9 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.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ironflock-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 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.0.tar.gz
Algorithm Hash digest
SHA256 65878dd9626ade1bac1877de116e78c47a6a5d474d6a01e6853706573b154342
MD5 67925fcf24428956b8d37a18cad0af18
BLAKE2b-256 6a1d403b3492d69c31cc8869a0b8e549da4ea2a0e3807649b8b261025fe29027

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ironflock-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fccfa6b21c487d73d281e76a5b1b27ba8c2ecb6a2c3ee64ae9490f0e7d4c1501
MD5 56ecdaf3ff09d2882a75e78d9b116c53
BLAKE2b-256 c3054535e81e5f954c4b59d2dc475f50a8a294948541fe625effb452855d245c

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