adsabs / bumblebee

🐝 Clever face for ADS
https://ui.adsabs.harvard.edu
GNU General Public License v2.0
38 stars 21 forks source link

Allow Exporting of Citation Metrics Data to Other Formats (csv, excel, etc.) #1189

Open thostetler opened 7 years ago

thostetler commented 7 years ago

Add ability to export citation data.

ehenneken commented 6 years ago

I see two possible approaches for this:

  1. Use some JavaScript library to convert the JSON data to the requested export format
  2. The metrics microservice creates a temporary file on S3

Given the complexity of the metrics data, Excel is probably the only reasonable format to export the report as a whole (this is currently done in the Metrics Report in Classic). Another option is to provide an export option per table/histogram to download the data, which greatly simplifies the data structures. The following scenario is (I think) the only use case: a user generates the Citation Metrics report and choses to do nothing further, print it or export it. The metrics microservice could save an Excel version or the report on S3, named with some unique identifier (and pass this identifier in the JSON sent to the UI). Clicking on "Download as Excel" contacts the metrics service with this identifier, which then responds with sending back the Excel data (with the proper content type header)

thostetler commented 6 years ago

It should be easy enough to generate a csv file from the data, would that suffice for excel? or would it have more to it than that?

aaccomazzi commented 6 years ago

Just a reminder that we are already doing something similar in the author-affiliation service, maybe there is code/approach to be reused here? @golnazads

golnazads commented 6 years ago

Author-Affiliation-service code is here https://github.com/adsabs/author_affiliation_service/blob/master/authoraffsrv/views.py#L242 basically you send out the buffer, content type, that we discovered the right content type for excel is application/vnd.ms-excel, and the file name to download buffer as.