HUB
Sign inSign up

iamnazzal/imc-calculadora

By iamnazzal

•Updated about 1 month ago

BMI (IMC) API + bilingual calculator page with WHO classes and healthy-weight range

Image
0

81

iamnazzal/imc-calculadora repository overview

⁠iamnazzal/imc-calculadora

A tiny BMI (IMC) API with the WHO adult classification and a bilingual (ES/EN) calculator page. No dependencies, runs as a non-root user, about 60 MB.

docker run --rm -p 8080:8080 iamnazzal/imc-calculadora

Open http://localhost:8080/⁠ for the calculator page, or call the API:

EndpointExampleReturns
GET /api/imc/api/imc?peso=82&altura=175{"bmi":26.8,"key":"sobrepeso","label":"Sobrepeso","healthyRange":{"minKg":56.7,"maxKg":76.3},"diffKg":5.7,…}
GET /api/imc (imperial)/api/imc?lb=154&in=69&lang=en"label":"Normal weight"
GET /api/rango/api/rango?altura=168{"minKg":52.2,"maxKg":70.3}
GET /api/clases/api/clasesthe 8 WHO classes with ES/EN labels
GET /healthz{"ok":true} (used by HEALTHCHECK)

Comma decimals work (peso=70,5&altura=1,68). lang=en switches labels and messages to English. English aliases: /api/bmi, /api/range, /api/classes.

  • WHO adult classes with the three thinness subclasses (severa, moderada, leve) and obesity classes I–III.
  • Rounds to 1 decimal before classifying, the way BMI is reported: 24.96 → 25.0 → Sobrepeso. No more "24.96 is normal" edge cases.
  • Healthy-weight range for a height (BMI 18.5 to 24.9) and how many kg are missing or extra.
  • Metric and imperial: kg + cm (or metres, 1,75), or lb + in using 703 · lb / in².
  • Comma or dot decimals (70,5 and 70.5 both work), handy for Spanish-language forms.
  • Spanish and English labels and messages, with a not-medical-advice note.
  • Library + CLI, no dependencies.

⁠WHO classes

KeyEspañolEnglishBMI (1 decimal)
delgadez_severaDelgadez severaSevere thinness< 16.0
delgadez_moderadaDelgadez moderadaModerate thinness16.0 – 16.9
delgadez_leveDelgadez leveMild thinness17.0 – 18.4
normalPeso normalNormal weight18.5 – 24.9
sobrepesoSobrepesoOverweight25.0 – 29.9
obesidad_1Obesidad grado IObesity class I30.0 – 34.9
obesidad_2Obesidad grado IIObesity class II35.0 – 39.9
obesidad_3Obesidad grado IIIObesity class III≥ 40.0

BMI is a general screening measure for adults and is not medical advice.

⁠License

MIT

Tag summary

Content type

Image

Digest

sha256:62fe0c6c9…

Size

58.5 MB

Last updated

about 1 month ago

docker pull iamnazzal/imc-calculadora