noahtren / noms Goto Github PK
View Code? Open in Web Editor NEWA fun and simple Python package that allows you to work with highly detailed nutrition data
License: MIT License
A fun and simple Python package that allows you to work with highly detailed nutrition data
License: MIT License
Using these data, is it possible to use the classes without calling the API? https://www.kaggle.com/stoicstatic/fooddata-central-nutrition-and-component-data
Description: The server requested closed the connection before
the transaction was completed.
Often, there are foods in one's diet that would be better left out entirely. That is, no recommendation of complementary foods could help someone who ate 3 Big Macs. The best recommendation is to simply not have the Big Macs.
A method should be added to analyze.py that takes a meal and nutrient dict as arguments and finds the top food that contributes most to the cost. This could be used to recommend that one has less of that food or drop it completely.
Added a module that provides recommendations and uses least squares regression to determine the level of nutrient satisfaction that a given meal has (Σ (rda - val)^2). This should be demonstrated as a test and the README should be updated to reflect its addition.
Newer data is available from https://fdc.nal.usda.gov/ which was released this week.
The package will need to be reworked so that it can work with the new API, as support for the legacy API will be dropped at some point.
It would be more python to make the print for results not need a special method name for users to remember. For example, it would be much more likely for me to try:
search_results = noms.get_results("Raw Broccoli", client)
print(search_results)
And this can be achieved by defining a class for your results and then defining __str__()
on that class. Even if that class is simply a simple dict wrapper, it can make your API more friendly to interact with.
Just a thought :)
The noms.search
module seems to depend explicitly on the client. And it seems better to leave these methods up to the client. The usage of doing:
import noms
client = noms.Client("api key")
search_results = noms.get_results("Raw Broccoli", client)
seems a little confusing compared to doing:
import noms
client = noms.Client("api key")
search_results = client.get_results("Raw Broccoli")
Is there a reason you pulled these out into a top level module? It feels more OO to call methods on the client.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.