[WIP FARMWARE] How to read a CSV file stored on the user's computer?


#1

(Also: Does Farmware support the Flask package?)

Hi guys. I’m part of a small group that wants to develop a piece of Farmware that takes a CSV file as input and turns it into a Farm Design. We’ve run into a hurdle where we don’t know how to read the CSV from the user’s computer so the Farmware can translate it into Farmbot commands.

I know the Farmware can accept short strings, and one of our ideas was to let the user type in the path to the file on their computer, then write Python code that gets the file from them through the internet using Flask. But I don’t know if Farmware supports the Flask package or if there is an easier way to do this.


#2

If the CSV file only includes plant data, have you considered writing a script that a user runs on their computer instead of a Farmware? The script could process a local CSV file and use the FarmBot Web App API to upload the plants. Depending on how the CSV file is generated, the code could potentially be incorporated into that program as well.

The Flask package is not currently available to Farmware. One way to accomplish something similar is for the user’s computer to serve the CSV file to the Farmware, which would also require the user to run a script (or server) locally. The user would input the URL for the file (instead of the local path) to the Farmware, and the Farmware would download it using an HTTP library (requests, etc.).

If Python isn’t a language requirement, another option may be to modify the FarmBot Web App directly to include this feature.


#3

Thank you for your advice. We’ve decided to make it a script that runs on the user’s computer. Changing the Web App itself is just more work than we can handle.