Some users want feed metadata as CSV instead of JSON. Add a format query string option to the feed metadata API. Defaults to JSON, but will accept csv (case insensitive) for CSV output of the metadata. Similar in spirit to the format option for export. More detail...
id,name,latitude,longitude
12668,AQMD_NASA_17 B PurpleAir,34.062618,-118.247131
12669,AQMD_NASA_18 PurpleAir,34.138439,-118.13797
12670,AQMD_NASA_18 B PurpleAir,34.138439,-118.13797
Things to deal with:
the CSV format loses the information about the total number of feeds available, the limit, and the offset. Maybe consider some other query string option which would cause a "commented-out" preamble to be included before the header with this information.
decide whether to allow selection of all fields. For example, does it really make sense to request the channelBounds JSON field in a CSV? Same for channelSpecs. Presumably, if you know how to deal with JSON, you'd want it all to be JSON.
strings with commas in them (but, are there any such fields? do we allow commas in feed names? the only other fields which could/would have commas are channelSpecs and channelBounds, but maybe we simply don't allow selection of those in CSV format?)
decide how to map null data. Present it as null or an empty string? For feed data export, the datastore uses empty string when the data is null, so maybe empty string here is nice for symmetry.
Some users want feed metadata as CSV instead of JSON. Add a
format
query string option to the feed metadata API. Defaults to JSON, but will acceptcsv
(case insensitive) for CSV output of the metadata. Similar in spirit to theformat
option for export. More detail...Currently, calling this:
Will return something like this:
This issue requests to extend the API so that calling this (note the addition of
&format=csv
at the end):would return this:
Things to deal with:
channelBounds
JSON field in a CSV? Same forchannelSpecs
. Presumably, if you know how to deal with JSON, you'd want it all to be JSON.channelSpecs
andchannelBounds
, but maybe we simply don't allow selection of those in CSV format?)null
or an empty string? For feed data export, the datastore uses empty string when the data is null, so maybe empty string here is nice for symmetry.