Data Engineering & Public Health Tools

Free Tools That Do the Nutrition Math for You

A calorie calculator, a restaurant meal finder, and a home meal cookbook — built on verified USDA data. No accounts. No ads. No cost.

Python USDA FoodData Central Geolocation PDF Data Extraction Cloudflare Pages

The Problem

Calorie counting is one of the most effective tools for managing body composition. It is also one of the most tedious. The friction isn’t conceptual — most people understand that eating fewer calories than you burn leads to weight loss. The friction is operational: figuring out what to eat, at which restaurant, in what portion, and whether the numbers you’re relying on are trustworthy.

The information exists, but it’s scattered. Restaurant nutrition data lives in PDFs buried on corporate websites — inconsistently formatted, sometimes outdated, often requiring a download just to check whether a sandwich fits your calorie target. Home cooking nutrition is worse: recipes describe ingredients in cups and tablespoons while nutrition databases measure in grams, and converting between them requires density tables most home cooks have never heard of.

This project grew out of a personal training practice in the Austin, Texas area. The trainer behind BAF Training saw this friction daily — clients who understood the principles still struggled with execution. The question wasn’t “what should I do?” but “what should I eat — right now, at this restaurant, with this budget, near my house?” So he built the tools himself.

The Core Insight: Nutrition planning fails at the point of decision, not the point of understanding. People don’t need more education about calories — they need tools that do the math for them, using data they can trust, at the moment they’re choosing what to eat.

The Approach

We built three tools, each addressing a different moment in the nutrition decision cycle. All three share a common foundation: the USDA FoodData Central database as the single authoritative source for nutrition values, systematic data validation at every stage, and free public access with no accounts, no tracking, and no ads.

The build followed a governed methodology — decisions documented before code was written, data sources verified before being trusted, and each phase confirmed before advancing. For a suite of tools that people use to make health decisions, we treated data accuracy as a non-negotiable constraint rather than a nice-to-have.

One more constraint, chosen deliberately: these tools are free. No subscriptions, no accounts, no tracking, no advertising. The entire suite runs on static hosting with zero ongoing cost. If a tool helps people make better health decisions, requiring a credit card or a tolerance for ads undermines the purpose. This commitment shaped every architectural decision that followed.

Principle Implementation
Authoritative data only All nutrition values sourced from USDA FoodData Central API with FDC identifiers tracked per ingredient
Systematic validation Multi-tier data quality checks: thermodynamic limits, compositional constraints, encoding normalization
Transparent methodology Scoring logic visible to users; no hidden algorithms or proprietary rankings
Free and private No accounts, no tracking cookies, no advertising. Static site hosting with zero ongoing cost to users

Tool 1: Calorie Calculator

📊

The Education Layer

Understand your numbers before you start counting.

Before a client can use a meal finder or follow a recipe, they need to know their target. The Calorie Calculator takes height, weight, age, sex, and activity level, then computes a Basal Metabolic Rate and Total Daily Energy Expenditure using industry-standard formulas consistent with NASM (National Academy of Sports Medicine) methodology.

The calculator goes beyond a single number. It generates a complete eating plan with four prioritized targets: total daily calories first, then protein, then sugar limits, then saturated fat. This priority ladder reflects how nutrition coaching actually works — get the big number right before worrying about macronutrient splits.

A deliberate constraint: weight loss goals are capped at two pounds per week. Aggressive deficit targets are a common source of diet failure and potential health risk. The tool won’t calculate them.

Try the Calculator →

Tool 2: Restaurant Meal Finder

🍽

The Restaurant Layer

Find what fits your target — before you leave the house.

This is the technical centerpiece of the suite. The Meal Finder contains verified nutrition data for over 11,000 menu items across 52 restaurants in the Austin, Texas metro area. A user enters their calorie target, optionally filters by protein, dietary preference, or restaurant, and the tool returns ranked results — scored by how well each item fits their nutritional goals.

The Data Challenge

Restaurant nutrition data does not come in a convenient format. Each chain publishes its own PDF — some as structured tables, others as dense multi-page documents with inconsistent column layouts, merged cells, encoding artifacts, and section breaks that confuse automated parsers. A single PDF might contain food items, beverages, desserts, and kids’ meals with no clear delimiter between sections.

Building a reliable dataset required a multi-stage approach:

52 Restaurant PDFs
Text Extraction
Schema Parsing
Quality Validation
11,297 Verified Items

The quality validation stage enforces rules that catch errors no manual review would find at scale. Every item is checked against thermodynamic limits (protein grams cannot exceed calories divided by four), compositional constraints (saturated fat cannot exceed total fat), and encoding normalization (Unicode artifacts from PDF extraction are cleaned systematically). Items that fail validation are excluded with a full audit trail — not silently dropped or manually overridden.

11,297
Menu Items
52
Restaurants
625
Locations Mapped
0
API Costs to Users

Location-Aware Search

Knowing that a Chipotle bowl fits your macros is less useful if the nearest Chipotle is 30 minutes away. The Meal Finder includes 625 mapped restaurant locations across the Austin metro area. Users can tap “Near Me” to use browser geolocation, or select a city from a dropdown. Results are then filtered and ranked by proximity using distance calculation — all computed client-side with zero API costs.

This was a deliberate architectural choice. Third-party mapping APIs charge per request. For a free tool that anyone can use without an account, per-request costs would either require funding or eventually force the tool offline. By pre-loading location data and computing distances in the browser, the tool remains permanently free to operate.

Try the Meal Finder →

Tool 3: Home Meal Cookbook

🍳

The Home Cooking Layer

Cook at home with the nutrition math already done.

The Cookbook answers the other half of the nutrition question: what to cook at home when you want to control exactly what goes in. It contains 38 recipes — each with gram-based ingredients, USDA-verified per-serving nutrition, and batch cooking instructions designed for weekly meal prep.

The Ingredient Verification Problem

Most recipe sites list nutrition estimates. Some calculate them. Very few trace every number back to a verified source. For this cookbook, every ingredient maps to a specific USDA FoodData Central identifier. The nutrition math works like this: each ingredient’s weight in grams is multiplied by the USDA nutrition value per 100 grams, then all ingredients are summed and divided by the number of servings.

This sounds straightforward until you encounter the unit conversion problem. Recipes say “1 cup of flour” but the USDA measures flour in grams. A cup of flour and a cup of honey weigh very different amounts. The conversion pipeline maintains density tables for common ingredients — grams per cup for dry goods, grams per tablespoon for spices, grams per teaspoon for seasonings — so that recipe quantities translate accurately to nutritional values.

Metric Value
Recipes 38 (5 original + 33 sourced and verified)
USDA-Backed Ingredients 134, each with FDC identifier
Nutrition Fields per Recipe Calories, protein, carbs, fat, fiber, sodium, sugar
Measurement Basis Gram-based (not volume-based) for accuracy

Each recipe also includes estimated cost per serving, making it possible to plan meals that hit both a calorie budget and a grocery budget simultaneously.

Built for Households, Not Individuals

The Cookbook is built for households, not individuals. Each family member gets their own calorie target, and the tool calculates individualized portion sizes from the same recipe — everyone eats the same meal, the portions do the math. A week builder assigns recipes to days and generates a single consolidated shopping list, with pantry staples separated from groceries you need to buy and overlapping ingredients across recipes combined automatically.

The result: pick recipes for the week, get one shopping list, cook in batches, portion for the family. The tool handles the arithmetic that makes meal prep tedious by hand — scaling, converting, and consolidating so the human work is cooking, not calculating.

Browse the Cookbook →

What Connects Them

These three tools share more than a domain. They share an evidence architecture.

The USDA FoodData Central database is the single source of truth for all nutrition values across the entire suite. The Calorie Calculator uses USDA-aligned formulas. The Meal Finder validates restaurant-published data against thermodynamic constraints derived from nutritional science. The Cookbook traces every ingredient to a specific USDA FDC identifier. Nothing is estimated from memory or copied from a secondary source.

The deployment architecture reinforces the “free forever” commitment. All three tools are static HTML and JavaScript hosted on Cloudflare Pages. There is no server, no database, no API calls at runtime, no authentication. The total ongoing cost to host the entire suite is zero. A user in 2030 can load the same URLs and get the same tools — no subscription lapses, no service degradation, no “free tier” that quietly throttles.

The Design Philosophy: If a tool helps people make better health decisions, it shouldn’t require a credit card, an account, or a tolerance for advertising. These tools are free because the person who built them wanted his clients — and anyone else who found them — to just use them.

The Outcome

3
Production Tools
11,297
Restaurant Menu Items
134
USDA-Verified Ingredients
$0
Cost to Users
Tool Status What It Does
Calorie Calculator Live Computes personalized calorie targets and macro priorities from user profile
Meal Finder Live Searches 11,297 menu items across 52 restaurants with location-aware filtering
Home Cookbook Live 38 recipes with USDA-verified nutrition and gram-based instructions

All three tools are live and in active use. They represent a complete nutrition planning workflow: understand your numbers, find meals that fit when eating out, and cook meals that fit when eating in. The entire suite was built with governed AI methodology — every data source verified, every decision documented, every deployment confirmed before going live.

Technical Appendix

Data Extraction & Validation

Restaurant nutrition PDFs were processed through a Python extraction and validation system. Raw text extraction handled encoding normalization (UTF-8 artifacts from PDF conversion), section boundary detection, and column alignment parsing. The validation layer applied three categories of automated checks:

// Validation rules (applied per-item, not aggregate) Thermodynamic: protein_g ≤ calories / 4 Thermodynamic: sugar_g ≤ calories / 4 Compositional: sat_fat_g ≤ total_fat_g Encoding: normalize Unicode artifacts per-field Section: detect category boundaries (food/beverage/dessert)

Of 12,008 initial items extracted, 11,297 passed all validation tiers. The 711 excluded items (5.9%) were primarily beverage and dessert entries caught by the thermodynamic checks — consistent with section-shift patterns in the source PDFs.

Location System

625 restaurant locations were mapped with GPS coordinates. Distance calculations use the Haversine formula computed entirely in client-side JavaScript. No external API is called at any point during the user session.

Ingredient Verification

134 ingredients are mapped to USDA FoodData Central API identifiers. The verification pipeline queries the USDA API for foundation nutrient data, stores results locally, and computes per-serving nutrition by summing (ingredient grams / 100) × USDA per-100g values across all recipe ingredients. Unit conversions use maintained density tables for volume-to-mass translation.

Deployment Stack

Hosting: Cloudflare Pages (static, globally distributed) Frontend: Vanilla HTML + CSS + JavaScript (no frameworks) Data: Pre-built JSON files loaded client-side Search: Client-side filtering and scoring (no server) Location: Browser Geolocation API + Haversine formula Cost: $0 operational / $0 to users

Conclusion

This project demonstrates what happens when data engineering meets a real human need with disciplined methodology. The nutrition data people rely on for health decisions deserves the same rigor as any other critical dataset — verified sources, systematic validation, transparent logic.

The three tools form a complete workflow built on a shared evidence foundation. They’re free, they’re live, and they work. That’s the case study.

This is governed AI craftsmanship: tools built with verified data, transparent methodology, and zero cost to the people who use them.
Back to Portfolio Start Your Project