codeforboston / flagging

Flagging website for CRWA
MIT License
4 stars 12 forks source link

Add raw hobolink data as a rest API #77

Open dwreeves opened 4 years ago

dwreeves commented 4 years ago

[Note: Do this task in the dev branch]

The base output should be something like this:

return {
        'time_returned': pd.to_datetime()
        'data': df.to_dict(orient='records')
    )

Just do a direct call to get_live_hobolink_data for now.

For parameters, we want hours to be a parameter; default value should be 24. I think that's probably it for now and I'm not sure what else we'd parametrize. (Maybe we can add Hobolink metadata as an optional thing that can be returned?

Notably, this API should be added to Swagger, and it should also have documentation associated with it. Look into this: https://swagger.io/docs/specification/about/ We are using the OpenAPI specification. It's a bit longwinded and you don't need to read all of it; you will best be served by looking at examples e.g. in the Flasgger README. https://github.com/flasgger/flasgger

dwreeves commented 4 years ago

(Still open)

dwreeves commented 3 years ago

This wouldn't take too long, but I'm not prioritizing this for 2021 boating season. There are already ways to access the raw HOBOlink data. (Well, true raw, not after we clean it up a bit.)