Git Product home page Git Product logo

oakschoolfood's Introduction

oakschoolfood

Hacking the Oakland school lunch program

Some resources developed during the National Day of Civic Hacking.

Menu Processor

process_menu.py is a first cut at code to parse an OUSD (Oakland Unified School District) menu and look up calorie counts for each item.

It can be run with the command

python process_menu.py

and has been tested only with Python 3.4.

To run it, you will need to get an API key from api.data.gov and add it to a local config file named config.py. The line in that file should look like:

API_DATA_GOV_KEY = 'YOURAPIKEY'

The current code reads in raw menu text from sample_menu.txt. The text is parsed into separate menu items and the nutritional content for each menu item is looked up using the USDA National Nutrient database. Specifically, a "best match" search is done and the top pick is used. Then, the calorie content is retrieved for that match. The best match is often not a particularly good match.

TODOs

Maybe turn these into GitHub issues.

  • Split items with connectors (e.g., hamburger w fries) into separate items so they can be looked up separately on the USDA site
  • Fight with OAUTH and the Python wrapper for Fat Secret, maybe converting it to Python 3, to bend it to my will (though at the same time fearing it doesn't add any value on top of the USDA site for our purposes)
  • Abstract out the menu parser so parsers can be written for other sources
  • Automate extraction of menu text from OUSD PDFs on the website
  • Try to get OUSD to share the source text going into Nutrikids to create the menus
  • Write a better matcher than the USDA one
  • Clean up the skanky code that comes with hack day projects

oakschoolfood's People

Contributors

kaypro4 avatar robertstewart avatar

Watchers

 avatar  avatar

Forkers

robertstewart

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.