Skip to main content

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.

Metadata

Release files for reswarm 0.0.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reswarm 0.0.19
File Size Uploaded
reswarm-0.0.19.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reswarm 0.0.19
File Interpreter ABI Platform
reswarm-0.0.19-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / reswarm-0.0.19.tar.gz

Download URL reswarm-0.0.19.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3d8cbf537d6c1040579adf6abe03743e36eb445584ea9c186b9a2437c53874cb
BLAKE2b-256 checksum
How to use checksums
7592ab7645d3f637ad28e85d49a6c9a1882034e1d22150be96921face469a1f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / reswarm-0.0.19-py3-none-any.whl

Download URL reswarm-0.0.19-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53f9ae4360453a8da558d1f76d5dea8ee4663dc4b3b6813e23d58e4a64e9f372
BLAKE2b-256 checksum
How to use checksums
2ff09fe0644d688b63d02e9be327f44398f9d7e10c47747958e7709d76e682ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.0.19 This release

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page