Note Before I Tell Story
cyapi.py will not work unless you have an API key, we removed ours
Inspiration
Determines field profitability by considering yield per acre (in bushels for corn, soybeans and wheat, in-lbs for cotton, and tons for hay), futures prices of these goods, and total cost of production per acre ## What it does
How we built it
We used an API to pull data about yield for each county in America into a .json file, which we then cleaned up. We then tried to calculate profitability by using the remaining parameters (prices*production - cost), and then dump it back into a .json file. Then we implemented a GUI that outputs the yield per acre of corn. This was not expanded upon as intended (explained in ## Challenges we ran into), but easily has the capability to do so.
Challenges we ran into
We tried to web scrape futures data such that we would have real-time prices updates, but we failed due to the complication of futures websites being dynamically coded, which made it harder for us to scrape. When we tried to use selenium driver for JS-coded websites, our chrome driver would not install properly, so we had to give up. Furthermore, due to an error in the json. dump, we were unable to repopulate the .json file with data of profitability, so right now our program only outputs yield per acre of corn, though with a little more time this could easily be fixed into the intended profitability output for each crop.
Accomplishments that we're proud of
We are proud of our newly acquired web scraping skills, regardless of the fact that we failed. Furthermore, we are very proud of having been able to use an api to pull so much data from the web, it was very satisfying having it work. It was not joke cleaning it up either, but we are proud we got it done.
What we learned
We learned web scraping skills using BeautifulSoup and Selenium, and learned how to use an api to export data as well as how to clean up a data set.
What's next for Field Profitability by County
While underdeveloped due to time constraints, our current application acts as a promising foundation in which users are easily able to access information related to crop profitability. This application has huge potential for future expansion: we could incorporate live crop futures and varying costs by county (fuel cost, tax rateā¦) through web scraping to make profitability per county more accurate. Moreover, we could create a website with an interactive heat map of profitability per acre by the county to present the data instead of a simple GUI. To make this website more useful we could increase significantly the number of crops we analyze, and we could create a web tool accessible to all farmers so that they can quickly see an accurate value of profitability by an acre of each crop in each area of the US.
Built With
- css
- html
- javascript
- python
- quickstats
Log in or sign up for Devpost to join the conversation.