senstream


Namesenstream JSON
Version 1.4.23 PyPI version JSON
download
home_page
SummaryPython package for managing and interacting with Resensys SenSpots.
upload_time2023-12-05 02:15:03
maintainer
docs_urlNone
authorResensys (Tom Wade)
requires_python
license
keywords python stream senspot resensys time series
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<img src="https://resensys.net:8443/static/images/resensys-logo-hollow.bmp" alt="resensys" width="300"/>

# SenStream (v 1.4.23)

**SenStream** is 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 for **structural health monitoring** and other scientific applications to make data collection, processing, and reporting end-to-end.

#### API Functionality

*   Extract and configure SenSpot parameters.
*   Pull time streams from SenSpots from the cloud

<br>
<img src="https://www.resensys.com/images/load-rating-app-note.png" alt="resensys_arch" width="700"/>

## Installation

#### Requirements

We recommend that you have a version of python >= 3.7 installed on your machine before proceeding. If the below `pip` command does not automatically install `pandas` and `numpy`, you should make sure that these libraries have been installed before proceeding.

#### Install using pip

To start using SenStream install using pip:

    pip install senstream

`pip` is 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 the [Python Package Index](https://pypi.org/).

Note the `pip` refers to the Python 3 package manager. In environment where Python 2 is also available the correct command may be `pip3`.

## Getting Started

The 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 records```
## SenSpot Object
Create 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()```
Returns **string**.

### Get the site ID assignment for the SenSpot:
```senspot.getSite()```
Returns **string** of format "xx-xx" with site ID.

### Get the local address assigned to the SenSpot (useful for wireless routing):
```senspot.getLocAddr()```
Returns **int**.

### View all available quantities associated with SenSpot:
```senspot.getQuantities()```
Returns **[string]**

### Check current calibration coefficients for SenSpot:
```senspot.getCoefficients()```
Returns **dict**

### Get general device summary of SenSpot:
```senspot.getDeviceInfo()```
Returns **dict**

## Extract Time Series from SenSpot
```senspot.timeStream(*args, **kwargs)```
* **df_name**: quantity being pushed by the SenSpot (complete list given by calling **getQuantities()** 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")

Returns **pandas.DataFrame** object.

#### Example to pull **previous two weeks of data** for 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 pull **custom time range** for SenSpot "Volt" quantity
```ss_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 with **downsample filter** of every six minutes for SenSpot "HPA-X" quantity
```ss_strain = senspot.timeStream("HPA-X", time=["12hour"], sample_int='M6')```


## Support

For any question on the usage of PROJECT please use the [Resensys Community Portal](). If you found a problem with the software, please [create an issue](https://github.com/resensys/PROJECT/issues) on GitHub. If you are a Greenbone customer, you may alternatively or additionally forward your issue to the Resensys Support Portal.

## Maintainer

This project is maintained by [Tom Wade](https://www.linkedin.com/in/thomas-shane-wade/) at Resensys, LLC.

## Contributing

Your contributions are highly appreciated. Please [create a pull request](https://github.com/greenbone/PROJECT/pulls) on GitHub. Bigger changes need to be discussed with the development team via the [issues section at GitHub](https://github.com/greenbone/PROJECT/issues) first.

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 use [pipenv](https://pipenv.readthedocs.io/en/latest/) to keep your Python packages separated in different environments. First install pipenv via pip

    pip install --user pipenv

Afterwards run

    pipenv install --dev

in 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 to thomas.wade@resensys.com.


## License

Copyright (C) 2023 [Resensys, LLC.](https://www.resensys.com/index.html)

Licensed under the [GNU General Public License v3.0 or later](LICENSE).



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "senstream",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,stream,senspot,resensys,time series",
    "author": "Resensys (Tom Wade)",
    "author_email": "<thomas.wade@resensys.com>",
    "download_url": "https://files.pythonhosted.org/packages/69/71/186fe2511a82515251eb9ee51b906b78463d9ded98e880f232bb0bee178c/senstream-1.4.23.tar.gz",
    "platform": null,
    "description": "\n<img src=\"https://resensys.net:8443/static/images/resensys-logo-hollow.bmp\" alt=\"resensys\" width=\"300\"/>\n\n# SenStream (v 1.4.23)\n\n**SenStream** is 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.\n\nThe SenStream project is designed to bridge the gap between the structural/civil engineer and the software developer for **structural health monitoring** and other scientific applications to make data collection, processing, and reporting end-to-end.\n\n#### API Functionality\n\n*   Extract and configure SenSpot parameters.\n*   Pull time streams from SenSpots from the cloud\n\n<br>\n<img src=\"https://www.resensys.com/images/load-rating-app-note.png\" alt=\"resensys_arch\" width=\"700\"/>\n\n## Installation\n\n#### Requirements\n\nWe recommend that you have a version of python >= 3.7 installed on your machine before proceeding. If the below `pip` command does not automatically install `pandas` and `numpy`, you should make sure that these libraries have been installed before proceeding.\n\n#### Install using pip\n\nTo start using SenStream install using pip:\n\n    pip install senstream\n\n`pip` is 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 the [Python Package Index](https://pypi.org/).\n\nNote the `pip` refers to the Python 3 package manager. In environment where Python 2 is also available the correct command may be `pip3`.\n\n## Getting Started\n\nThe following demonstrates what you need to get started with a connection to the Resensys cloud and check that you can extract data.\n\n\n\n```\n# import the necessary libraries and modules\nimport numpy as np\nimport pandas as pd\n\nfrom senstream.resensys import Resensys,Sensors\nfrom senstream.senspot import SenSpot\n\n# for users with SenScope license, specify username and password\nusername,password = \"test_user\",\"user_password\" \n\n# create a client connection to resensys.net\nclient = Resensys(username,password)\n\n# create Sensors object to check all sensors in present account\nsensors = Sensors(client)\n\n# get list of all devices in the client account as pandas dataframe\nsensor_df = sensors.getSensors(format=\"dataframe\")\n\n# print list of all the sensors in the account\nprint(sensor_df['DID'].tolist())\n```\n\n### View all active site registered for current user:\n```sensors.getSites(format=\"dataframe\")```\n### View current routing parameters for SenSpots:\n```sensors.getRouting(format=\"dataframe\").head(5)  # display first five records```\n## SenSpot Object\nCreate 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.\n\n```senspot = SenSpot(client,\"15-03-27-74\")```\n\n### Get the name assigned to the SenSpot:\n```senspot.getName()```\nReturns **string**.\n\n### Get the site ID assignment for the SenSpot:\n```senspot.getSite()```\nReturns **string** of format \"xx-xx\" with site ID.\n\n### Get the local address assigned to the SenSpot (useful for wireless routing):\n```senspot.getLocAddr()```\nReturns **int**.\n\n### View all available quantities associated with SenSpot:\n```senspot.getQuantities()```\nReturns **[string]**\n\n### Check current calibration coefficients for SenSpot:\n```senspot.getCoefficients()```\nReturns **dict**\n\n### Get general device summary of SenSpot:\n```senspot.getDeviceInfo()```\nReturns **dict**\n\n## Extract Time Series from SenSpot\n```senspot.timeStream(*args, **kwargs)```\n* **df_name**: quantity being pushed by the SenSpot (complete list given by calling **getQuantities()** method)\n* **time**: options = \"1hour\", \"2hour\", \"6hour\", \"12hour\", \"24hour\", \"48hour\", \"1week\", \"2week\", \"4week\", \"6month\", \"12month\", \"2year\", \"custom\"\n* **sample_int**: options = ''(default), 'M1', 'M6', 'M15', 'M30', 'H1', 'H4', 'H6', 'H12', 'D1', 'W1', 'W2', 'MN1', 'MN3', 'MN6', 'YR'\n\nIf you choose a custom time range, then you must specify additional parameters:\n* **t_s**: Start Time (UTC) (e.g. \"2020-09-21 17:00:00\")\n* **t_e**: End Time (UTC) (e.g. \"2020-09-21 17:00:00\")\n\nReturns **pandas.DataFrame** object.\n\n#### Example to pull **previous two weeks of data** for SenSpot quantities \"Strain-xx-high_rate\" and \"Internal Temperature\"\n```ss_strain = senspot.timeStream(\"Strain-xx-high_rate\", time=[\"2week\"])```\n\n```ss_temperature = senspot.timeStream(\"Internal Temperature\", time=[\"2week\"])```\n\n#### Example to pull **custom time range** for SenSpot \"Volt\" quantity\n```ss_strain = senspot.timeStream(\"Volt\", time=[\"custom\"], t_s=\"2023-07-14 00:00:30\", t_e=\"2023-07-14: 18:40:20\")```\n\n#### Example to pull data with **downsample filter** of every six minutes for SenSpot \"HPA-X\" quantity\n```ss_strain = senspot.timeStream(\"HPA-X\", time=[\"12hour\"], sample_int='M6')```\n\n\n## Support\n\nFor any question on the usage of PROJECT please use the [Resensys Community Portal](). If you found a problem with the software, please [create an issue](https://github.com/resensys/PROJECT/issues) on GitHub. If you are a Greenbone customer, you may alternatively or additionally forward your issue to the Resensys Support Portal.\n\n## Maintainer\n\nThis project is maintained by [Tom Wade](https://www.linkedin.com/in/thomas-shane-wade/) at Resensys, LLC.\n\n## Contributing\n\nYour contributions are highly appreciated. Please [create a pull request](https://github.com/greenbone/PROJECT/pulls) on GitHub. Bigger changes need to be discussed with the development team via the [issues section at GitHub](https://github.com/greenbone/PROJECT/issues) first.\n\nState here if contributions are welcome. State the requirements a contribution should meet to get merged.\n\nDetails about development, like creating a dev environment or running tests, also belong here, for example:\n\nFor development, you should use [pipenv](https://pipenv.readthedocs.io/en/latest/) to keep your Python packages separated in different environments. First install pipenv via pip\n\n    pip install --user pipenv\n\nAfterwards run\n\n    pipenv install --dev\n\nin the checkout directory of PROJECT (the directory containing the Pipfile) to install all dependencies including the packages only required for development.\n\nIf there are more specific suggestions for development or guidelines for contributions, consider sending an email to thomas.wade@resensys.com.\n\n\n## License\n\nCopyright (C) 2023 [Resensys, LLC.](https://www.resensys.com/index.html)\n\nLicensed under the [GNU General Public License v3.0 or later](LICENSE).\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python package for managing and interacting with Resensys SenSpots.",
    "version": "1.4.23",
    "project_urls": null,
    "split_keywords": [
        "python",
        "stream",
        "senspot",
        "resensys",
        "time series"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b1f22aa9d73b9613a45a306e3d3284d3f514a9d179f0780c8a19c70433be45a",
                "md5": "7d06f48b04d7e995cce4b0d4790b1c3f",
                "sha256": "46de576f5f0213c103efb7be12be63db0c32bfc6598418a0ffa2abc8e764d84a"
            },
            "downloads": -1,
            "filename": "senstream-1.4.23-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d06f48b04d7e995cce4b0d4790b1c3f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 20176,
            "upload_time": "2023-12-05T02:15:00",
            "upload_time_iso_8601": "2023-12-05T02:15:00.645938Z",
            "url": "https://files.pythonhosted.org/packages/2b/1f/22aa9d73b9613a45a306e3d3284d3f514a9d179f0780c8a19c70433be45a/senstream-1.4.23-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6971186fe2511a82515251eb9ee51b906b78463d9ded98e880f232bb0bee178c",
                "md5": "d9ec1713cd4f1ecbd7586af7fca86f50",
                "sha256": "9fa38770eb61af96cfaf238a5089f00ec87b3176391371460dcd7bd206100574"
            },
            "downloads": -1,
            "filename": "senstream-1.4.23.tar.gz",
            "has_sig": false,
            "md5_digest": "d9ec1713cd4f1ecbd7586af7fca86f50",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20847,
            "upload_time": "2023-12-05T02:15:03",
            "upload_time_iso_8601": "2023-12-05T02:15:03.371483Z",
            "url": "https://files.pythonhosted.org/packages/69/71/186fe2511a82515251eb9ee51b906b78463d9ded98e880f232bb0bee178c/senstream-1.4.23.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-05 02:15:03",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "senstream"
}
        
Elapsed time: 0.31074s