tdt / core

Transform any dataset into an HTTP API with The DataTank
http://thedatatank.com
83 stars 31 forks source link

Provide an API call to check which data formats are offered for a data set. #400

Closed daften closed 8 years ago

daften commented 8 years ago

E.g. {csv, json} So an external application can show direct links to the different data formats.

coreation commented 8 years ago

In api/info you can pass a parameter "dataset" to retrieve all of its information, including the formats. They are formatted in the following way:

formats : {
    "CSV" : "csv",
    "JSON" : "json"
}

the key => value is meant to be a mapping of the display name (can be altered to anyone's choosing) to the actual format name that TDT will understand.

Jeroen005 commented 8 years ago

Woudn't it be nice to have this information also available in api/definitions?

coreation commented 8 years ago

Hi @Jeroen005 the api/definitions URI is meant to store/edit/delete definitions, meaning data points that a user can control. The available formats however are data points that are derived based on the configuration of a dataset, meaning they are beyond the control of a user. I'd therefore just leave it to the api/info endpoint instead of api/definitions. But I understand why you'd intuitively want it there.