Closed roshanr10 closed 6 years ago
https://medium.com/ibm-watson-data-lab/simple-csv-import-for-couchdb-71616200b095 might explain it a little better than I did. If you want I can make a bash script to automate it but it's pretty quick so I didn't think that was necessary.
I'd prefer to not require a bash script... I was thinking more along the lines of a JavaScript file upload input that then converts to JSON and imports in the browser.
Requiring a team to use bash is kind of a pain, and this also means they must have internet access. File upload doesn't, it'll go straight to the local PouchDB.
@nickdelta52 Do you think you could help with this? Skip the DB and match-specifics for now, but could you create a HTML5 document with a file upload form that takes takes a CSV, parses it into JSON, and calls a function?
For the following matches.csv
:
team, points
4909, 1
811, 2
function handleCsvUpload(jsonData){}
jsonData = [{ "team": 4909, "points": 1 },{ "team": 811, "points": 2 }]
You can do this as a separate HTML file for now, and we can work on integration into a tab for it later.
@roshanr10 Sure, we can start working on this now, when do you want this done by?
@nickdelta52 Awesome, would say next Wednesday be doable?
I know it's a short timeline, but the sooner the base is done, the more we can move onto more advanced features. Let me know if you think you'll need more time.
Base CSV upload mechanism is posted here, and is ready to be integrated following the DB API: https://gist.github.com/nickdelta52/e9594710e6feec01e9e99d8b3f557b0e#file-csvparser-html
Teams 449 and 2791 would like to contribute data to TGA, but currently use Excel. I would like to integrate a CSV uploader to allow this. Just parse and import each doc to the CouchDB database.
I'm sure some other teams would like something like this to work with their existing workflows.