Rafael M. Martins
569fb7d87a
|
7 months ago | |
---|---|---|
Data | 7 months ago | |
py | 7 months ago | |
web-html | 7 months ago | |
.gitignore | 8 months ago | |
README.md | 7 months ago |
README.md
Data: https://lnu.box.com/s/5whjdw6f5mft0h62676h30g24kx6xagg
Instructions
All the lines below should be run inside the 'py' subdirectory.
- Run 'python import.py' to create the database.
- Run 'python -m flask --app main run' to start the API server.
By default the API will be available at http://localhost:5000.
Endpoints
Parallel
/parallel/daily
Returns data formatted for the 'daily' parallel coordinates view.
URL parameters:
- 'day' [Mandatory]: in the format YYYY-MM-DD.
- 'family' [Optional; default: 'S1']: name of family of sensors.
- 'type' [Optional; default: 'celsius']: type of sensor.
/parallel/weekly
Returns data formatted for the 'weekly' parallel coordinates view.
- 'week' [Optional; default: 1]: week number, 1-52.
- 'year' [Optional; default: 2023]: year.
- 'family' [Optional; default: 'S1']: name of family of sensors.
- 'type' [Optional; default: 'celsius']: type of sensor.
/parallel/monthly
Returns data formatted for the 'monthly' parallel coordinates view.
- 'month' [Optional; default: 1]: month number, 1-12.
- 'year' [Optional; default: 2023]: year.
- 'family' [Optional; default: 'S1']: name of family of sensors.
- 'type' [Optional; default: 'celsius']: type of sensor.
/parallel/yearly
Returns data formatted for the 'yearly' parallel coordinates view.
- 'year' [Optional; default: 2023]: year.
- 'family' [Optional; default: 'S1']: name of family of sensors.
- 'type' [Optional; default: 'celsius']: type of sensor.
Grid
/grid/weekly
Returns data formatted for the 'weekly' grid view.
- 'week' [Optional; default: 1]: week number, 1-52.
- 'year' [Optional; default: 2023]: year.
- 'sensor' [Optional; default: 'S1:1']: name of the sensor.
- 'type' [Optional; default: 'celsius']: type of sensor.
/grid/monthly
Returns data formatted for the 'monthly' grid view.
- 'month' [Optional; default: 1]: month number, 1-12.
- 'year' [Optional; default: 2023]: year.
- 'sensor' [Optional; default: 'S1:1']: name of the sensor.
- 'type' [Optional; default: 'celsius']: type of sensor.
/grid/yearly
Returns data formatted for the 'yearly' grid view.
- 'year' [Optional; default: 2023]: year.
- 'sensor' [Optional; default: 'S1:1']: name of the sensor.
- 'type' [Optional; default: 'celsius']: type of sensor.
Horizon
/horizon/daily
Returns data formatted for the 'daily' horizon view.
- 'day' [Optional; default: '2023-01-01']: in the format YYYY-MM-DD.
- 'family' [Optional; default: 'S1']: name of family of sensors.
- 'type' [Optional; default: 'celsius']: type of sensor.
/horizon/weekly
Returns data formatted for the 'weekly' horizon view.
- 'week' [Optional; default: 1]: week number, 1-52.
- 'year' [Optional; default: 2023]: year.
- 'family' [Optional; default: 'S1']: name of family of sensors.
- 'type' [Optional; default: 'celsius']: type of sensor.
/horizon/monthly
Returns data formatted for the 'monthly' horizon view.
- 'month' [Optional; default: 1]: month number, 1-12.
- 'year' [Optional; default: 2023]: year.
- 'family' [Optional; default: 'S1']: name of family of sensors.
- 'type' [Optional; default: 'celsius']: type of sensor.
/horizon/yearly
Returns data formatted for the 'yearly' horizon view.
- 'year' [Optional; default: 2023]: year.
- 'family' [Optional; default: 'S1']: name of family of sensors.
- 'type' [Optional; default: 'celsius']: type of sensor.
NOTE: For 2023 the data goes only up to August (8 months).
Saved Flexiboards
/boards
[ { Board_ID [int], Name [String], Description [String] } ]
/boards/save
Method: POST
Every time we call save, it is a new board. ID is auto generated. Name must be unique.
{ Name [String], Description [String], col-left: [ { order [int], id [String], text [String], api_url [int] }, { ... } ], }
/boards/[Board_ID]
{ Board_ID [int], Name [String], Description [String], Parallel: [ { order [int], id [String], text [String], api_url [int] }, { ... } ], }