2024-11-10 18:12:09 +00:00
|
|
|
# Nutri
|
|
|
|
|
|
|
|
Nutri is a C++ project that retrieves and processes nutritional information from various sources.
|
|
|
|
|
|
|
|
## Currently supported sources
|
|
|
|
|
|
|
|
- [x] WolframAlpha
|
|
|
|
- [ ] OpenFoodFacts
|
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
- [x] Fetch and display nutrition data
|
|
|
|
- [ ] Export data to a CSV file
|
|
|
|
- [ ] Cache previous queries
|
|
|
|
- [ ] alternative [QT](qt.io) based GUI
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
### Dependencies
|
|
|
|
|
|
|
|
- [`glaze`](https://github.com/stephenberry/glaze)
|
|
|
|
- [`cpr`](https://github.com/libcpr/cpr)
|
|
|
|
- [`ctre`](https://github.com/hanickadot/compile-time-regular-expressions)
|
|
|
|
|
|
|
|
These libraries will be fetched automatically via CMake if they are not already installed on your system.
|
|
|
|
|
|
|
|
### Clone the repository
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone --depth=1 https://git.etenie.net/etenie/nutri.git
|
|
|
|
cd nutri
|
|
|
|
```
|
|
|
|
|
|
|
|
### Build with CMake
|
|
|
|
|
|
|
|
```bash
|
2024-11-10 20:39:27 +00:00
|
|
|
cmake -B build -DCMAKE_BUILD_TYPE=Release
|
2024-11-11 13:22:08 +00:00
|
|
|
cmake --build build -j$(nproc)
|
2024-11-10 18:12:09 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Now you will find the `nutri` executable in the `build` dir.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
-h, --help: Print help
|
|
|
|
-f, --food: Specify the food item
|
|
|
|
-a, --amount: Specify the amount (in grams)
|
|
|
|
```
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./nutri -f "ground beef" -a 100
|
|
|
|
Cals: 236 kcal
|
|
|
|
Protein: 26 g
|
|
|
|
Carbs: 0 g
|
|
|
|
Fats: 14 g
|
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|