Python Client
A single-file Python module that implements the full WaterlyConnect payload model using only
the standard library. No pip install required — copy the file alongside your script,
import it, and you're submitting. Ideal for utility scripts, cron jobs, and lightweight adapter services.
3.12+Python version
0External dependencies
.pySingle file artifact
Prerequisites
- Python 3.12 or newer in the environment running the script.
- A Waterly-provided submission URL, client token, and device identity (
idandtype). - The
waterlyconnect_client.pymodule accessible to your script — either copied locally or added toPYTHONPATH. - Outbound HTTPS access to the WaterlyConnect endpoint.
Quick Start
- 1Download the module. Place
waterlyconnect_client.pyin the same directory as your script or somewhere onPYTHONPATH. - 2Create the config. Provide your submission URL, client token, and a
ClientDeviceInfoobject withidandtype. - 3Build tags and submit. Create a list of
TagDatumobjects and callclient.submit_data(tags).
Submission Example
import time
from waterlyconnect_client import (
ClientDeviceInfo,
TagDatum,
WaterlyConnectApiClient,
WaterlyConnectApiClientConfig,
)
config = WaterlyConnectApiClientConfig(
url="https://app.waterlyapp.com/connect/submit",
client_token="your-client-token",
client_device=ClientDeviceInfo(
id="lift-station-04",
type="Python Adapter",
),
)
client = WaterlyConnectApiClient(config)
tags = [
TagDatum(
name="WetWellLevel",
value=12.7,
last_change_timestamp=int(time.time()),
unit="FT",
),
TagDatum(
name="PumpStatus",
value=1.0,
last_change_timestamp=int(time.time()),
),
]
client.submit_data(tags)
Files