Package: senstream
SenStream (v 1.4.23)SenStreamis a python package for managing and interacting with Resensys SenSpot devices. Streamline data flows from SenSpot technologies and high-level data pipelines with this high-level software development kit.The SenStream project is designed to bridge the gap between the structural/civil engineer and the software developer forstructural health monitoringand other scientific applications to make data collection, processing, and reporting end-to-end.API FunctionalityExtract and configure SenSpot parameters.Pull time streams from SenSpots from the cloudInstallationRequirementsWe recommend that you have a version of python >= 3.7 installed on your machine before proceeding. If the belowpipcommand does not automatically installpandasandnumpy, you should make sure that these libraries have been installed before proceeding.Install using pipTo start using SenStream install using pip:pip install senstreampipis the de facto and recommended package-management system written in Python and is used to install and manage software packages. It connects to an online repository of public packages, called thePython Package Index.Note thepiprefers to the Python 3 package manager. In environment where Python 2 is also available the correct command may bepip3.Getting StartedThe following demonstrates what you need to get started with a connection to the Resensys cloud and check that you can extract data.# import the necessary libraries and modules
import numpy as np
import pandas as pd

from senstream.resensys import Resensys,Sensors
from senstream.senspot import SenSpot

# for users with SenScope license, specify username and password
username,password = "test_user","user_password" 

# create a client connection to resensys.net
client = Resensys(username,password)

# create Sensors object to check all sensors in present account
sensors = Sensors(client)

# get list of all devices in the client account as pandas dataframe
sensor_df = sensors.getSensors(format="dataframe")

# print list of all the sensors in the account
print(sensor_df['DID'].tolist())View all active site registered for current user:sensors.getSites(format="dataframe")View current routing parameters for SenSpots:sensors.getRouting(format="dataframe").head(5)  # display first five recordsSenSpot ObjectCreate an instance of a SenSpot object by referencing the previous client connection and specifying the device ID of the SenSpot from the user's sensor list.senspot = SenSpot(client,"15-03-27-74")Get the name assigned to the SenSpot:senspot.getName()Returnsstring.Get the site ID assignment for the SenSpot:senspot.getSite()Returnsstringof format "xx-xx" with site ID.Get the local address assigned to the SenSpot (useful for wireless routing):senspot.getLocAddr()Returnsint.View all available quantities associated with SenSpot:senspot.getQuantities()Returns[string]Check current calibration coefficients for SenSpot:senspot.getCoefficients()ReturnsdictGet general device summary of SenSpot:senspot.getDeviceInfo()ReturnsdictExtract Time Series from SenSpotsenspot.timeStream(*args, **kwargs)df_name: quantity being pushed by the SenSpot (complete list given by callinggetQuantities()method)time: options = "1hour", "2hour", "6hour", "12hour", "24hour", "48hour", "1week", "2week", "4week", "6month", "12month", "2year", "custom"sample_int: options = ''(default), 'M1', 'M6', 'M15', 'M30', 'H1', 'H4', 'H6', 'H12', 'D1', 'W1', 'W2', 'MN1', 'MN3', 'MN6', 'YR'If you choose a custom time range, then you must specify additional parameters:t_s: Start Time (UTC) (e.g. "2020-09-21 17:00:00")t_e: End Time (UTC) (e.g. "2020-09-21 17:00:00")Returnspandas.DataFrameobject.Example to pullprevious two weeks of datafor SenSpot quantities "Strain-xx-high_rate" and "Internal Temperature"ss_strain = senspot.timeStream("Strain-xx-high_rate", time=["2week"])ss_temperature = senspot.timeStream("Internal Temperature", time=["2week"])Example to pullcustom time rangefor SenSpot "Volt" quantityss_strain = senspot.timeStream("Volt", time=["custom"], t_s="2023-07-14 00:00:30", t_e="2023-07-14: 18:40:20")Example to pull data withdownsample filterof every six minutes for SenSpot "HPA-X" quantityss_strain = senspot.timeStream("HPA-X", time=["12hour"], sample_int='M6')SupportFor any question on the usage of PROJECT please use theResensys Community Portal. If you found a problem with the software, pleasecreate an issueon GitHub. If you are a Greenbone customer, you may alternatively or additionally forward your issue to the Resensys Support Portal.MaintainerThis project is maintained byTom Wadeat Resensys, LLC.ContributingYour contributions are highly appreciated. Pleasecreate a pull requeston GitHub. Bigger changes need to be discussed with the development team via theissues section at GitHubfirst.State here if contributions are welcome. State the requirements a contribution should meet to get merged.Details about development, like creating a dev environment or running tests, also belong here, for example:For development, you should usepipenvto keep your Python packages separated in different environments. First install pipenv via pippip install --user pipenvAfterwards runpipenv install --devin the checkout directory of PROJECT (the directory containing the Pipfile) to install all dependencies including the packages only required for development.If there are more specific suggestions for development or guidelines for contributions, consider sending an email tothomas.wade@resensys.com.LicenseCopyright (C) 2023Resensys, LLC.Licensed under theGNU General Public License v3.0 or later.