Can I export data?

Follow

Yes: There are a few ways of exporting data: 

Use the Exosite API

You can use our API to pull data out, we'd recommend the JSON RPC, which has a 'read' function with multiple options.

JSON RPC API

Here is an example python script that will pull data out and store within a CSV file: 

Archive Data Utility.

 

Command Line Tool (Exoline)

The Exoline command line tool is a python application that uses Exosite's APIs to give users a quick way to access Exosite's platform.  It provides commands to read and write data, check on scripts, look at the hierarchy tree of clients, make a copy of a client (device) and most importantly export data to a csv file.  Information including installation steps can be found here: https://github.com/dweaver/exoline

An example of dumping multiple dataports to a csv file:



$ time ./exo.py read 2ca4f441538c1f2cc8bfaaaaaaaaaaaaaaaaaaaa gas temperature humidity event --start=5/1/2013 --end=8/1/2013 --chunkhours=24 > alldata.csv

real 1m58.377s
user 0m10.981s
sys 0m0.506s

$ wc -l alldata.csv
316705 alldata.csv

 

Here is an example of how to export all dataports for a given client CIK with a configurable date range and limit (max number of data points given per dataport):

#!/bin/bash
# Usage export.sh <cik> > data.csv
# Requires jq

CIK="$1"
TYPE=dataport
LIMIT=100000
START=10/1/2013
END=now
HEADER=name
TIMEFORMAT=iso8601

RIDS=$(exo listing $1 --type=$TYPE --pretty | jq -r '.[][]' | tr '\n' ' ')

exo read $CIK $RIDS --start=$START --end=$END --limit=$LIMIT --header=$HEADER --timeformat=$TIMEFORMAT

 

Download a CSV from Portals

Note: This approach has limits on the number of data points that can be pulled and the time period you can select.

1. Go to your accounts data source manage page (e.g. https://portals.exosite.com/manage/data)

2. Click on the data source you are interested in to bring up the data source pop-up window.

3. On the right-hand side, there is a box called "Data Log".  Next to that heading is a link called 'Export Data'.  

export_link.png

4. Click the Export Data link, which will open a box showing your data source selected (you can select others if you wish) and some calendar buttons to select a time period.  

export_window.png

5. Hit 'Continue' button and the next window will provide you with a link (it actually says 'this link') and if you click that it will start to download a .csv file.

download_link.png

Note: There is a restriction on how much data for each data source (30 days) at a time.

 

Custom Domain Widgets

For Subdomain vendors that would like to provide options for end users to export data, the Widget API has a 'read' function that can pull data and is not limited to any number of data points.  The custom widget would need to be written to provide the user a way to select the time period and provide the user status, as it could take time to generate.

Custom Widget API Document

Example Line Graph that uses the widget 'read' function to graph many data points

  

Other Options

We have other functionality to do a push archive to Amazon S3.  Contact us for more information.

Have more questions? Submit a request

Comments