datopian / data-api

Next generation Data API for data management systems including CKAN.
https://tech.datopian.com/data-api/
MIT License
9 stars 3 forks source link

CSV response format for graphql read API #5

Closed rufuspollock closed 3 years ago

rufuspollock commented 4 years ago

When I have selected the data I want in the Build Report I want to be able to download in CSV format so that I can use it easily in my tools e.g. a spreadsheet, database etc

Acceptance

Tasks

Analysis

Current

/.../graphql

POST request

{  query MyQuery {
    build_report_capacityauction {
      MonthlyAuctionConRentDKK_DK1
      UtilizedExportCapacity_DK1
    }
  }
}

New

POST with existing type of body to:

.../graphql?format=json|csv|xlsx

Options

New format:

Option 1:

POST /.../

Nicest:

.../graphql?format=json|csv|xlsx

Option 2:

{
  "format": "json | csv | xlsx",
  "graphql": "query MyQuery {
    build_report_capacityauction {
      MonthlyAuctionConRentDKK_DK1
      UtilizedExportCapacity_DK1
    }
  }"
}
leomrocha commented 3 years ago

All formats supported by (js-xlsx)[https://github.com/SheetJS/sheetjs] will be easy to support with data-api after the current branch is tested and merged to the master. For accepted formats read Library Documentation

rufuspollock commented 3 years ago

@leomrocha 👏 👏

Can we add a comment when closing as per https://playbook.datopian.com/issues-tasks/#closing-issues

leomrocha commented 3 years ago

Functionality implemented and tested in the Merged code feature/downloads PR #20