fooddatacentral

Python code to obtain information from the USDA's Food Data Central data project.

https://github.com/ligon/fooddatacentral

Science Score: 64.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    2 of 3 committers (66.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Python code to obtain information from the USDA's Food Data Central data project.

Basic Info
  • Host: GitHub
  • Owner: ligon
  • License: other
  • Language: Python
  • Default Branch: master
  • Size: 18.6 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 3
  • Open Issues: 0
  • Releases: 1
Created over 6 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

FoodDataCentral

DOI

The USDA maintains a database of nutritional information, where different kinds of food are identified by an FDC number. They do not provide any data on prices.

To look up nutritional information, use api provided by the USDA at https://fdc.nal.usda.gov/. You should sign up for a free api key (see directions on page), then add that key here in place of “DEMOKEY”.

apikey = "DEMO_KEY"  # Replace with a real key!  "DEMO_KEY" will be slow...

Looking up foods

I’ve written a little module fooddatacentral with the methods

  • search
  • nutrients
  • units

FDC Search

Here’s a little code to help look up FDC codes for foods of different descriptions.

import fooddatacentral as fdc

fdc.search(apikey,"crunchy peanut butter")

FDC Nutrients

Once we know the fdc_id of a particular food we can look up a variety of information on it. We start with nutrients

id =     # Put an FDC ID HERE!
fdc.nutrients(apikey,fdc_id=id)

FDC Ingredients

We can also look up the ingredients for many foods (specifically Survey Foods) in the FDC:

fdc.ingredients(apikey,id)

Owner

  • Name: Ethan Ligon
  • Login: ligon
  • Kind: user
  • Location: Berkeley, California
  • Company: University of California

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: fooddatacentral
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Ethan
    family-names: Ligon
    email: ligon@berkeley.edu
    affiliation: 'University of California, Berkeley'
    orcid: 'https://orcid.org/0000-0003-4928-0616'
title: "fooddatacentral"
version: 0.2
doi:10.5281/zenodo.7020171
date-released: 2022-08-11

GitHub Events

Total
  • Fork event: 1
Last Year
  • Fork event: 1

Committers

Last synced: about 3 years ago

All Time
  • Total Commits: 20
  • Total Committers: 3
  • Avg Commits per committer: 6.667
  • Development Distribution Score (DDS): 0.35
Top Committers
Name Email Commits
Ethan Ligon l****n@b****u 13
Amy Ai a****1@A****l 6
aiaay a****7@b****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 1
  • Total pull requests: 3
  • Average time to close issues: 2 days
  • Average time to close pull requests: 3 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.67
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mycomedico (1)
Pull Request Authors
  • aiaay (3)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 42 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
pypi.org: fooddatacentral

Python module to obtain information from the USDA's Food Data Central data project.

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 42 Last month
Rankings
Dependent packages count: 6.6%
Forks count: 19.6%
Downloads: 20.2%
Average: 23.2%
Dependent repos count: 30.6%
Stargazers count: 39.1%
Maintainers (1)
Last synced: 10 months ago

Dependencies

setup.py pypi