Python 3 utility for converting plasma glucose ("blood sugar") units using argument parsing.
Convert:
- milligram per decileter to millimole per liter (mg/dl to mmol/l), or
- millimole per liter to milligram per decileter (mmol/l to mg/dl),
and receive a table of the conversion, e.g:
mg/dl | mmol/l |
---|---|
70.0000 | 3.8850 |
71.0000 | 3.9405 |
72.0000 | 3.9960 |
73.0000 | 4.0515 |
74.0000 | 4.1070 |
Install argparse with:
pip3 install argparse
Synopsis:
[-h] [--mg-to-mmol MG_TO_MMOL [MG_TO_MMOL ...] | --mmol-to-mg MMOL_TO_MG [MMOL_TO_MG ...]]
Single conversion:
python3 gluctool.py --mmol-to-mg 4.0515
Multiple conversions:
python3 gluctool.py --mg-to-mmol 7{0..9}
- Upload to Python Package Index (PyPi). For reference