Skip to main content

Package for working with DIYAPs files

Project description

DIYAPS Toolbox

The DIYAPS (Do-it-yourself Artificial Pancreas) Toolbox provides a set of functions for working with the data which can be extracted from AndroidAPS, Loop (iOS) and OpenAPS systems. The following table provides an overview of all the data items which can be calculated using this module. Each of the functions is explained in detail below:



Data Item Description Function
Days of data donated The period of time contained in the donated data based on the earliest and latest timestamp calculate_days_donated(date, date_format = "%Y-%m-%d-%H:%M:%S")
Mean sensor glucose Mean of all sensor glucose values in the Entries file calculate_glucose_mean(glucose_values)
Standard deviation of sensor glucose Standard deviation of all sensor glucose values in the Entries file calculate_glucose_sd(glucose_values)
Coefficient of Variation of sensor glucose Coefficient of variation of all sensor glucose values in the Entries file calculate_glucose_cov(glucose_values)
Glucose Managment Indicator Function for estimating the HbA1c value based on mean sensor glucose, as proposed by [1]. calculate_gmi(glucose_values)
% Time in Range The time spent within the optimal range (by default set to 70 and 180 mg/dL) as a percentage calculate_time_in_range(glucose_values, lower= 70, upper= 180)
% Time below Range Calculates the time spent below a certain threshold value (default = 70 mg/dL) calculate_time_below_range(glucose_values, lower = 70)
% Time above Range Calculates the time spent above a certain threshold value (default= 180 mg/dL) calculate_time_above_range(glucose_values, upper = 180)
Number of hypoglcemic episodes per day The mean number of hypoglycemic episodes per day. This function considers how often the blood glucose level dropped below the threshold (default = 70 mg/dL) calculate_hypos_per_day(glucose_values, date, lower= 70, date_format = "%Y-%m-%d-%H:%M:%S")
Number of hyperglycemic episodes per day The mean number of hyperglycemic episodes per day. This function considers how often the blood glucose level rose above the threshold (default = 180 mg/dL) calculate_hypers_per_day(glucose_values, date, upper= 180, date_format = "%Y-%m-%d-%H:%M:%S")
Percentage of persistent hypoglcemic episodes The amount of hypoglycemic episodes that persisted for longer than 2 hours, as a percentage of all hypoglycemic episodes calculate_persistent_hypo(glucose_values, lower= 70)
Percentage of persistent hyperglcemic episodes The amount of hyperglycemic episodes that persisted for longer than 4 hours, as a percentage of all hypoglycemic episodes calculate_persistent_hyper(glucose_values, upper = 180)
Percentage of overtreated hypoglcemic episodes The percentage of hypoglycemic episodes that resulted in subsequent hyperglycemia within 2 hours calculate_overtreated_hypo(glucose_values, lower= 70, upper = 180)
Percentage of overtreated hyperglcemic episodes The percentage of hyperglycemic episodes that resulted in subsequent hypoglycemia within 4 hours calculate_overtreated_hyper(glucose_values, upper= 180, lower = 70)
Number of meal boluses per day The mean number of meal boluses per day calculate_meal_bolus_per_day(treatment_df, date_format = "%Y-%m-%d-%H:%M:%S")
Number of correction boluses per day The mean number of correction boluses per day calculate_correction_bolus_per_day(treatment_df, date_format = "%Y-%m-%d-%H:%M:%S")
Grams of carbohydrates per day The mean number of carbohydrates entered into the system per day calculate_carbs_per_day(treatment_df, date_format = "%Y-%m-%d-%H:%M:%S")
Units of correction insulin per day The mean number of insulin units administered by the system as a correction bolus per day calculate_correction_units_per_day(treatment_df, date_format = "%Y-%m-%d-%H:%M:%S")
Grams of carbs per meal The mean number of carbohydrates per meal bolus calculate_carbs_per_bolus(treatment_df)
Units of insulin per correction dose The mean number of insulin units per correction bolus calculate_correction_units_per_day(treatment_df, date_format = "%Y-%m-%d-%H:%M:%S")



Installation

pip install diyaps_toolbox

[1]: Richard M. Bergenstal, Roy W. Beck, Kelly L. Close, George Grunberger, David B. Sacks, Aaron Kowalski, Adam S. Brown, Lutz Heinemann, Grazia Aleppo, Donna B. Ryan, Tonya D. Riddlesworth, and William T. Cefalu. “Glucose Management Indica- tor (GMI): A New Term for Estimating A1C From Continuous Glucose Monitoring”. In: Diabetes Care 41.11 (Sept. 2018), pages 2275–2280. doi: 10.2337/dc18-1581. url: https://doi.org/10.2337/dc18-1581.

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

diyaps_toolbox-0.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

diyaps_toolbox-0.0.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file diyaps_toolbox-0.0.2.tar.gz.

File metadata

  • Download URL: diyaps_toolbox-0.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

File hashes

Hashes for diyaps_toolbox-0.0.2.tar.gz
Algorithm Hash digest
SHA256 282387182f936f0e7c5d5bbf4121f5464691947b1e49243617ee438f61454026
MD5 615a9bb97224b241f364a8026a8779be
BLAKE2b-256 7b03c5656153c47ec269673b113b91c3f26bb56ef5eb8f384d56e2839791283a

See more details on using hashes here.

File details

Details for the file diyaps_toolbox-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: diyaps_toolbox-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

File hashes

Hashes for diyaps_toolbox-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0784b8d03a2f79d74e99478fcc26fda9b46263a281ab6402f2d2a8362b0c2e1e
MD5 9bf1ed98c693a4e214546f4480ebdc15
BLAKE2b-256 5874eb9627fdd931c899860a70d1a58c5db9e641f70eb5cd3c3534011af3eccb

See more details on using hashes here.

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