Open ghost opened 9 years ago
Hey @jclark754 - these are good ideas. For me, they bring up two bigger picture questions:
@lesserwhirls, I think the module is so simple I'll stick with just supporting the units provided in the API. That's simple enough and practical for right now. I'm just hesitant to add another dependency I think.
Could you elaborate on 2? The API usually returns a json dict unless you set the output variable to 'csv' but this is only for a select few endpoints (climatology and timeseries I think). It would be neat to provide a simple function that writes a csv file to the user's working directory after any data has been retrieved. .
So with the second point, I was just wondering if the requested csv file from the server contains a header in the first few lines of the file that contains useful information.
If you want to get csv from all endpoints, then I would simply always request a json return and write a function to convert the json dict to a csv file. It's possible code for that already exists somewhere.
Considering adding these two functions as a little extra utility for the user. Units can be changed in the API call and some endpoints allow output as csv. However, I think it would be beneficial to provide some accessible functions if the user wanted to change the units or write to csv any subset of data from the api request instead of making multiple requests, constantly changing the request, or writing their own code. Any thoughts are appreciated.