growthcharts 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
growthcharts/patient.py CHANGED
@@ -81,3 +81,40 @@ class Patient:
81
81
  if wt is not None and length is not None:
82
82
  length_m = self.length / 100 # Convert cm to meters
83
83
  self.bmi = self.wt / (length_m * length_m)
84
+
85
+ def _normalize_sex(self):
86
+ s = str(self.sex).lower()
87
+ if s in ['m', '1']:
88
+ return '1'
89
+ if s in ['f', '2']:
90
+ return '2'
91
+ raise TypeError("define sex as m or f")
92
+
93
+ def _interpret_z(self, z):
94
+
95
+ if z < -3:
96
+ return "Severely Low"
97
+ elif -3 <= z < -2:
98
+ return "Low"
99
+ elif -2 <= z <= 2:
100
+ return "Normal"
101
+ elif 2 < z <= 3:
102
+ return "High"
103
+ else:
104
+ return "Severely High"
105
+
106
+ def _interpret_percentile(self, p):
107
+
108
+ if p < 3:
109
+ return "Severely Low"
110
+ elif 3 <= p < 10:
111
+ return "Low"
112
+ elif 10 <= p <= 90:
113
+ return "Normal"
114
+ elif 90 < p <= 97:
115
+ return "High"
116
+ else:
117
+ return "Severely High"
118
+
119
+
120
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: growthcharts
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Pediatric Growth Chart Analyzer
5
5
  Home-page: https://drdehghani.ir/
6
6
  Author: Javad Dehghani MD
@@ -29,6 +29,7 @@ Dynamic: requires-dist
29
29
  Dynamic: requires-python
30
30
  Dynamic: summary
31
31
 
32
+ # GrowthCharts
32
33
 
33
34
  **GrowthCharts** is a pediatric growth chart analyzer for infants (0–2 years) and children (2–20 years).
34
35
  It provides Z-score calculation, percentiles, and growth chart visualization based on CDC growth standards.
@@ -66,10 +67,10 @@ baby.plot_hcageinf(title="Head Circumference-for-Age")
66
67
  baby.plot_wtleninf(title="Weight-for-Length")
67
68
 
68
69
  # Calculate Z-scores and percentiles
69
- print(baby.analyze_wtageinf()) # Example output: {'Z': -0.23, 'Percentile': 41.0}
70
- print(baby.analyze_lenageinf()) # Example output: {'Z': 0.12, 'Percentile': 55.0}
71
- print(baby.analyze_hcageinf()) # Example output: {'Z': 0.30, 'Percentile': 62.0}
72
- print(baby.analyze_wtleninf()) # Example output: {'Z': -0.15, 'Percentile': 44.0}
70
+ print(baby.analyze_wtageinf()) # Example: {'Z': -0.23, 'Percentile': 41.0, 'Interpretation': 'Normal'}
71
+ print(baby.analyze_lenageinf()) # Example: {'Z': 0.12, 'Percentile': 55.0, 'Interpretation': 'Normal'}
72
+ print(baby.analyze_hcageinf()) # Example: {'Z': 0.30, 'Percentile': 62.0, 'Interpretation': 'Normal'}
73
+ print(baby.analyze_wtleninf()) # Example: {'Z': -0.15, 'Percentile': 44.0, 'Interpretation': 'Normal'}
73
74
  Child example (2–20 years)
74
75
  from growthcharts import Child
75
76
 
@@ -82,38 +83,63 @@ child.plot_lenage(title="Height-for-Age")
82
83
  child.plot_bmiage(title="BMI-for-Age")
83
84
 
84
85
  # Calculate Z-scores and percentiles
85
- print(child.analyze_wtage()) # Example output: {'Z': 0.12, 'Percentile': 55.0}
86
- print(child.analyze_lenage()) # Example output: {'Z': -0.08, 'Percentile': 47.0}
87
- print(child.analyze_bmiage()) # Example output: {'Z': 0.05, 'Percentile': 52.0}
86
+ print(child.analyze_wtage()) # Example: {'Z': 0.12, 'Percentile': 55.0, 'Interpretation': 'Normal'}
87
+ print(child.analyze_lenage()) # Example: {'Z': -0.08, 'Percentile': 47.0, 'Interpretation': 'Normal'}
88
+ print(child.analyze_bmiage()) # Example: {'Z': 0.05, 'Percentile': 52.0, 'Interpretation': 'Normal'}
88
89
  Classes
89
90
  Patient
90
91
  Base class storing sex, age, weight, and length.
91
-
92
92
  Calculates BMI if both weight and length are provided.
93
93
 
94
94
  Infant(Patient)
95
- Handles infants 0–24 months:
95
+ Handles infants 0–24 months.
96
+
97
+ Plotting methods:
98
+
99
+ plot_wtage
100
+
101
+ plot_lenageinf
102
+
103
+ plot_hcageinf
104
+
105
+ plot_wtleninf
106
+
107
+ Analysis methods:
108
+
109
+ analyze_wtageinf
110
+
111
+ analyze_lenageinf
96
112
 
97
- Plotting methods: plot_wtage, plot_lenageinf, plot_hcageinf, plot_wtleninf
113
+ analyze_hcageinf
98
114
 
99
- Analysis methods: analyze_wtageinf, analyze_lenageinf, analyze_hcageinf, analyze_wtleninf
115
+ analyze_wtleninf
100
116
 
101
117
  Child(Patient)
102
- Handles children 2–20 years:
118
+ Handles children 2–20 years.
103
119
 
104
- Plotting methods: plot_wtage, plot_lenage, plot_bmiage
120
+ Plotting methods:
105
121
 
106
- Analysis methods: analyze_wtage, analyze_lenage, analyze_bmiage
122
+ plot_wtage
123
+
124
+ plot_lenage
125
+
126
+ plot_bmiage
127
+
128
+ Analysis methods:
129
+
130
+ analyze_wtage
131
+
132
+ analyze_lenage
133
+
134
+ analyze_bmiage
107
135
 
108
136
  Data
109
137
  CSV data files for growth standards are included with the package under the data/ folder.
110
138
 
111
139
  Infant: wtageinf.csv, lenageinf.csv, hcageinf.csv, wtleninf.csv
112
-
113
140
  Child: wtage.csv, lenage.csv, bmiage.csv
114
141
 
115
142
  These are loaded automatically by the classes and do not need separate downloading.
116
143
 
117
- ## License
118
-
119
- This project is licensed under the MIT License.
144
+ License
145
+ This project is licensed under the MIT License.
@@ -1,7 +1,7 @@
1
1
  growthcharts/__init__.py,sha256=uz86qu7pvRE6d6u9LzvkDEtgIdEIL3uNzg68UkM-qpI,158
2
- growthcharts/child.py,sha256=tG-ZHsHW9z3o2gSKgAl2efSmT1ZBNTD7TWbAdzfOxuA,8049
3
- growthcharts/infant.py,sha256=3V-oZMYwdsuXxAKWYKi4JFqStP6uc4El0Mge0vAANBw,10205
4
- growthcharts/patient.py,sha256=k2YyI40Mqc1LLUeolYc_aErQ_GCsPkSYcw6xpoI04u4,2566
2
+ growthcharts/child.py,sha256=YrakovpsuMzK7wQQbwYnlui-2LcJdh8nSIwHRtlBWOk,11961
3
+ growthcharts/infant.py,sha256=cHn71XeGZdyBtccjtXX7WIeZ_1xMXZ0JbfreG9HgGTE,16219
4
+ growthcharts/patient.py,sha256=Ynwj1TCTlRnnNSe9A6df8lWCCMT7RzcCaPig8dy_wUI,3429
5
5
  growthcharts/data/bmiage.csv,sha256=BmguJSxoZX18bEL0Ghm8iCXjtvfKQlxZM-ecSl15IRw,71966
6
6
  growthcharts/data/hcageinf.csv,sha256=v34tevj9szbwsVnkgEFIQhNtqWDqanMLfnPRBgtFSek,11486
7
7
  growthcharts/data/lenage.csv,sha256=RRMNKp18UMVKR-e6Ymtmxh1FVLwtkBGYzt2UGaU_clE,66087
@@ -9,8 +9,8 @@ growthcharts/data/lenageinf.csv,sha256=KegxT307ygmZYBY5WzSAowDmQcFLfYY-kI2Bu2nVo
9
9
  growthcharts/data/wtage.csv,sha256=NAbJ0SW8tpwGKp6E64wCCb_pNGVCvcHTCGQ3UNzCQbc,66456
10
10
  growthcharts/data/wtageinf.csv,sha256=cyId1N6C65pwwebdRcm54oX6Gj1__0lxw7hcG-bl_u0,11446
11
11
  growthcharts/data/wtleninf.csv,sha256=PdYWyNEa2K1UcJKUd2Ceb8RMsuX3uVSUBh4UE6ADQkk,18242
12
- growthcharts-0.1.0.dist-info/licenses/LICENSE.txt,sha256=tk4TnSD1f1WzXTVNPfWR6fEpRm5hU1mZ0NHok-Rpoho,538
13
- growthcharts-0.1.0.dist-info/METADATA,sha256=-zydaGS6izH4MSekyBaSz7PMqqi32u6TK4CUMVTrAK0,3586
14
- growthcharts-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
15
- growthcharts-0.1.0.dist-info/top_level.txt,sha256=NrQH8H-pBGbQNfr4ZP_EqjBsMZFiTVkMW5XILdC7xjc,13
16
- growthcharts-0.1.0.dist-info/RECORD,,
12
+ growthcharts-0.2.0.dist-info/licenses/LICENSE.txt,sha256=tk4TnSD1f1WzXTVNPfWR6fEpRm5hU1mZ0NHok-Rpoho,538
13
+ growthcharts-0.2.0.dist-info/METADATA,sha256=v9brmJHT6K-aKeBsaA_McnH_MU0LPe4Fq6BwQcZA3XU,3771
14
+ growthcharts-0.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
15
+ growthcharts-0.2.0.dist-info/top_level.txt,sha256=NrQH8H-pBGbQNfr4ZP_EqjBsMZFiTVkMW5XILdC7xjc,13
16
+ growthcharts-0.2.0.dist-info/RECORD,,