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
anthrov1.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
Metadata
Release files for anthro 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anthro-1.1.1.tar.gz | 301.2 kB | With provenance | Details for anthro-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anthro-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for anthro-1.1.1-py3-none-any.whl |
Total release size: 454.0 kB
Release files / anthro-1.1.1.tar.gz
| Download URL | anthro-1.1.1.tar.gz |
|---|---|
| Size | 301.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74f6212d069815d30f16f5e42343154736da1ea9e34e5c67a66fd5edfd428752
|
|
BLAKE2b-256 checksum How to use checksums |
7b1edd53ecac48f096a883f2ab78b103e92d1f33fe078014d708e8b7fea99a8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency logRelease files / anthro-1.1.1-py3-none-any.whl
| Download URL | anthro-1.1.1-py3-none-any.whl |
|---|---|
| Size | 152.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
388e49566f344157a95b57075d067485b75df6fb9e7cd38711bbf47b53668b57
|
|
BLAKE2b-256 checksum How to use checksums |
a667bf3a807b650b0404b2420ae0cf8c4a6b40522ac1249004bd95eae34c0f6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency logSecurity for anthro 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for anthro-1.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.