Skip to main content

WHO 2006 Child Growth Standards — z-scores and classifications for 6 indicators

Project description

anthro (Python)

WHO 2006 Child Growth Standards — z-scores and classifications for 6 indicators.

Python port of the JavaScript library @flame-cai/anthro, sharing the same WHO LMS tables, formula, and output schema.

Website: https://flame-cai.github.io/anthro
PyPI: https://pypi.org/project/anthro
npm: https://www.npmjs.com/package/@flame-cai/anthro

Installation

pip install anthro

Quick start

from anthro import compute, batch

# Single child — by date of birth
result = compute({
    'sex':       'female',
    'dob':       '2024-01-15',
    'measured':  '2025-01-15',
    'weight_kg': 7.0,
    'height_cm': 64.0,
    'muac_mm':   136,
})
print(result['z_lhfa'])          # -2.7901
print(result['lhfa'])            # 'Moderately stunted'
print(result['wfa'])             # 'Normal'
print(result['muac_threshold'])  # 'Normal'

# By age in days
result = compute({'sex': 'm', 'age_days': 365, 'weight_kg': 9.5, 'height_cm': 75.2})

# Month mode
result = compute({'sex': 'f', 'age_months': 12, 'weight_kg': 9.0, 'height_cm': 74.5, 'mode': 'month'})

# Batch
results = batch([
    {'sex': 'm', 'age_days': 200, 'weight_kg': 6.8, 'height_cm': 63.0},
    {'sex': 'f', 'age_days': 400, 'weight_kg': 8.2, 'height_cm': 75.0},
])

API

compute(params)dict

Parameter Type Description
sex str 'm'/'f'/'male'/'female'/'1'/'2'
dob str | date Date of birth ('YYYY-MM-DD' or date)
measured str | date Date measured (required with dob)
age_days float Age in days (alternative to dob/measured)
age_months float Age in months (alternative)
weight_kg float Weight in kg
weight_g float Weight in g (alternative)
height_cm float Length/height in cm
muac_mm float MUAC in mm
muac_cm float MUAC in cm (alternative)
measure 'L' | 'H' Recumbent (L) or standing (H); auto-inferred if omitted
oedema bool Default False
mode 'day'|'month' Default 'day'

Missing inputs return a descriptive string (not None) for the affected indicators — all other indicators are still computed.

Return dict keys

mode, sex, age_days, age_months, weight_kg, height_cm_raw, height_cm_adj, muac_mm, bmi_val, measure, measure_correction, z_lhfa, z_wfa, z_wflh, z_bmi, z_acfa, flag_lhfa, flag_wfa, flag_wflh, flag_bmi, flag_acfa, muac_threshold, acfa, bmi, lhfa, wfa, wflh, errors, warnings

batch(rows, default_mode='day')list[dict]

Low-level helpers

from anthro import lms_z, age_days, months_to_days, classify

z = lms_z(X=9.5, L=0.1, M=10.0, S=0.12)
d = age_days('2022-01-01', '2023-01-01')  # → 365
classify.muac(110)     # → 'SAM'
classify.zscore(-2.5)  # → 'MAM'

Table sources

Tables are shared from the repository's data/ directory — no duplication.

  • Day-indexed (default): extracted from the R package anthro v1.1.0 (WHO-maintained, CRAN) — the same tables used by WHO igrowup SAS/SPSS/Stata software.
  • Month-indexed: WHO 2006 published monthly supplementary tables.

References

  • WHO MGRS (2006). WHO Child Growth Standards. Geneva: WHO. ISBN 924154693X
  • Formula: Restricted LMS + SD23 adjustment — WHO (2006) §5.2
  • Cut-points: WHO (2009). ISBN 9789241598163

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anthro-1.1.1.tar.gz (301.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anthro-1.1.1-py3-none-any.whl (152.7 kB view details)

Uploaded Python 3

File details

Details for the file anthro-1.1.1.tar.gz.

File metadata

  • Download URL: anthro-1.1.1.tar.gz
  • Upload date:
  • Size: 301.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anthro-1.1.1.tar.gz
Algorithm Hash digest
SHA256 74f6212d069815d30f16f5e42343154736da1ea9e34e5c67a66fd5edfd428752
MD5 666947bcb04ef226021f2b41b676f446
BLAKE2b-256 7b1edd53ecac48f096a883f2ab78b103e92d1f33fe078014d708e8b7fea99a8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for anthro-1.1.1.tar.gz:

Publisher: ci.yml on flame-cai/anthro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anthro-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: anthro-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 152.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anthro-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 388e49566f344157a95b57075d067485b75df6fb9e7cd38711bbf47b53668b57
MD5 e6f1eeb6e7fdffe714a41fb93485148c
BLAKE2b-256 a667bf3a807b650b0404b2420ae0cf8c4a6b40522ac1249004bd95eae34c0f6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for anthro-1.1.1-py3-none-any.whl:

Publisher: ci.yml on flame-cai/anthro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page