https://github.com/nodef/infoods
Kit for International Network of Food Data Systems (INFOODS).
https://github.com/nodef/infoods
component data food identifier infoods international network systems tagnames
Last synced: about 2 months ago
JSON representation
Kit for International Network of Food Data Systems (INFOODS).
- Host: GitHub
- URL: https://github.com/nodef/infoods
- Owner: nodef
- License: agpl-3.0
- Created: 2019-12-07T21:20:45.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-05-12T13:57:02.000Z (5 months ago)
- Last Synced: 2025-08-10T18:29:17.997Z (2 months ago)
- Topics: component, data, food, identifier, infoods, international, network, systems, tagnames
- Language: TypeScript
- Homepage: https://jsr.io/@nodef/infoods
- Size: 149 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Kit for International Network of Food Data Systems ([INFOODS]).
This package provides utilities for accessing standardized food composition data, including abbreviation resolution (e.g., expanding `GLVs` to `Green Leafy Vegetables`) and nutrient tagname lookups (e.g., mapping `vitamin C` to its INFOODS code `VITC`), with functions to load datasets, generate SQL/CSV schemas, and query terms through flexible pattern matching.
▌
📦 [JSR](https://jsr.io/@nodef/infoods),
📰 [Docs](https://jsr.io/@nodef/infoods/doc).
```javascript
import * as infoods from "jsr:@nodef/infoods";
// infoods.loadAbbreviations(): Map {key => {abbr, full}}
// infoods.abbreviationsSql([table], [options]): SQL commands to create abbreviations table
// infoods.abbreviationsCsv(): Path to csv file
// infoods.abbreviations()
// → {abbr, full} if supported, null otherwise.await infoods.loadAbbreviations();
// Load corpus firstinfoods.abbreviations('GLVs');
infoods.abbreviations('g l v s');
// → Green Leafy Vegetablesinfoods.abbreviations('what is D.R.I.');
infoods.abbreviations('d. r. i. stands for?');
/* (full stops must immediately follow character, if present) */
/* (for single character abbreviations, full stop is mandatory) */
// → Dietary reference intake
``````javascript
import * as infoods from "jsr:@nodef/infoods";
// infoods.loadTagnames(): Map {code => {code, name, synonyms, unit, tables, comments, examples}}
// infoods.tagnamesSql([table], [options]): SQL commands to create tagnames table
// infoods.tagnamesCsv(): Path to csv file
// infoods.tagnames()
// → [{code, name, synonyms, unit, tables, comments, examples}] for matched tagnamesawait infoods.loadTagnames();
// Load corpus firstinfoods.tagnames('vitamin c');
infoods.tagnames('c-vitamin');
// → [
// → {
// → code: 'VITC',
// → name: 'vitamin C',
// → synonyms: 'ascorbic acid; ascorbate (Note that these terms are not true synonyms but are often found in food tables to refer to vitamin C.)',
// → unit: 'mg',
// → tables: 'USDA 401, SFK, MW, ETH, IND, NE, EA, PRC, DAN',
// → comments: 'L-ascorbic acid plus L- dehydroascorbic acid.',
// → examples: ''
// → },
// → ...
// → ]infoods.tagnames('what is butyric acid?');
infoods.tagnames('c4:0 stands for?');
// → [
// → {
// → code: 'F4D0F',
// → name: 'fatty acid 4:0; expressed per quantity of total fatty acids',
// → synonyms: 'butyric acid; tetranoic acid',
// → unit: 'g/100 g fatty acid',
// → tables: 'MW, FRN, DAN, SWD',
// → comments: '',
// → examples: ''
// → },
// → ...
// → ]
```
## License
As of 18 April 2025, this project is licensed under AGPL-3.0. Previous versions remain under MIT.
[](https://wolfram77.github.io)




[](https://nodef.github.io)
[INFOODS]: http://www.fao.org/infoods/infoods/en/