glucograph


Nameglucograph JSON
Version 1.0.5 PyPI version JSON
download
home_page
SummaryThis project contains an application, which plots data exported from CGM (Continuous Glucode Monitoring) system. Currently only data exported from xDrip (https://github.com/NightscoutFoundation/xDrip) is recognized by this program. THIS APPLICATION SHOULD NOT BE USED TO MAKE MEDICAL DECISIONS.
upload_time2023-01-28 21:47:06
maintainer
docs_urlNone
authorMarko K
requires_python>=3.8
licenseGPL v3
keywords glucose xdrip
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GlucoGraph

This project contains an application, which plots data exported 
from CGM (Continuous Glucode Monitoring) system. Currently only data exported 
from [xDrip](https://github.com/NightscoutFoundation/xDrip) is recognized by
this program.

__IMPORTANT__: RESULTS OD THIS PROGRAM SHOULD NOT BE USED TO MAKE MEDICAL 
DECISIONS. THERE IS NO WARRANTY FOR THE PROGRAM. THE COPYRIGHT HOLDERS AND/OR 
OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, 
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. 
SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY 
SERVICING, REPAIR OR CORRECTION.

The program shows the data in charts, which can be shown on screen or saved to
file. It is written in Python, so it should run in any environment, where
Python runs.

Example screenshot:

![screenshot](doc/screenshot-1.png)



Installation
---

### 1. Install Python

To run this application, we need Python installed on your system. While it is
preinstalled in most popular Linux distributions, we have to install it 
on [Windows](https://docs.python.org/3/using/windows.html#windows-store) and
[Mac](https://docs.python.org/3/using/mac.html).

### 2. Install this program
 
Open shell (Terminal/Konsole/... on Linux, cmd or Power Shell on Windows)
and type:

    pip install --upgrade glucograph

## Export data from xDrip


Follow these steps:

a) Open xDrip on your phone and select the three dots menu in the top right corner.
   Select _Import / Export features_ and then _Export database_. File with SQLite
   database is created on your phone in _xdrip_ folder in internal storage. It is
   usually named as `export<date>-<time>.zip`. 

b) Copy the exported database file to your computer
   where you have installed _glucograph_. This can be done in several ways:
   - connect your phone to computer with USB cable, and allow copying 
     files on the phone. The use file explorer to navigate to directory 
     dxrip on the phone and copy the zipped sqlite file to the computer.
   - share the exported file via Google Drive, email, ...

c) Unzip the file to get file with extension _sqlite_. 

## Create charts

To create charts open shell in directory with your exported database file and type:

    glucograph [options] <name-of-exported-db-file>.sqlite

This application supports many configuration parameters like start date, number
of days on a chart, ..., which can be specified on a command line when running
the program. To see all available options and parameters, run:

    glucograph -h

## Examples

This section demonstrates usage of the most useful parameters. In the 
following examples we'll assume the name of our exported database file as
`export20230117-221514.sqlite`.

### Set units

Default units for blood glucose are `mmol/l`. To see values in `mg/dl` specify 
option `--mgdl`, for example:

    glucograph --mgdl 2023-01-01 export20230117-221514.sqlite

### Define start date

Suppose we want to see data beginning with 1st Jan. Specify this with 
parameter `--start`:

    glucograph --start 2023-01-01 export20230117-221514.sqlite

The date should be given in ISO format (yyyy-mm-dd).

### Show only five days (five charts)

Specify the number of shown days with parameter `-d` or `--days`:

    glucograph --days 5 --start 2023-01-01 export20230117-221514.sqlite

### Specify range for Y axis and reference values other than defaults

This example sets min value on Y axis to 2 mmol/l and the maximum one to 
15 mmol/l. Reference values for low and high values of blood glucose are 
set to 3.9 mmol/l and 8.0 mmol/l respectively:

    glucograph --ymin 2 --ymax 15 --ref_min 3.9 --ref_max 8 --start 2023-01-01 export20230117-221514.sqlite

Note: If you specify option `--mgdl`, then all the above parameters must be 
given in mg/dl.

### Print some statistics only

This parameter currently ignores all other parameters, like start day and 
number of days. It calculates statistics for all data in the database file.

    glucograph --stats export20230117-221514.sqlite

### Show also glucose measurements from finger pricks

If you control your CGM with finger pricks, but do not enter this data into
CGM, and your blood glucose monitoring system supports exports of data, you can
show this data together with CGM values with option `--gmeter`:

    glucograph --gmeter data/next_one-2023-01-09.csv export20230117-221514.sqlite

Data in the specified files must be given in CSV format, where each row
contains: 

    YYYY-mm-DD HH:MM:SS, <value>, <unit>

for example:

    2022-08-15 21:25:56, 4.3, mmol/L
    2022-08-16 22:18:02, 5.8, mmol/L
    2022-08-17 20:13:33, 4.4, mmol/L

### Show meals

If you are on a diet with meals at the same time each day, you can also show
these. First you have to create a file with description in the following format:

    <hh:mm>, <color>, <description text>

Example:

    4:15, c, CS 30g
    7:40, y, CS 30g

For available colors see 
[Matplotlib Color Formats](https://matplotlib.org/stable/tutorials/colors/colors.html).

### Control visible data

xDrip database contains also treatments and notes, if we enter them. To show
them in charts, we have to specify options `--show_treatments`, and `--show_calibrations`:

    glucograph --show_treatments --show_calibrations export20230117-221514.sqlite

### Save chart to file

To send chart to other people, we can save it to file. Only PDF format is 
currently supported:

    glucograph --save --days 31 --start 2022-12-01 export20230117-221514.sqlite

Number of days may be greater in such case, because we are not limited with 
screen size.  

Special considerations
---

When showing treatments, the application treats text which contains 
only float value as blood glucose value and draws it at Y position corresponding to the
float value. However, no effort is currently made to convert this value to 
the specified glucose units. This means that values given in different unit 
than selected, will not be shown at correct Y position.

Note: We use notes to record glucose value obtained with finger prick 
when CGM shows wrong value due to known 
reason, for example cold, pressure, ... It is not a good idea to calibrate CGM 
in such case, but it is useful to record the correct blood glucose.

## Support
If you find a bug in the application or have an idea for a new feature, then 
please open an issue in GitLab.

## Roadmap

1. Add simple GUI to set options.
2. Add options to set colors.

## Contributing

If you'd like to contribute to the project, please create a pull request. Note
that all code must be PEP-8 compliant.

## License

This project is licensed under GPL v3.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "glucograph",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "glucose,xDrip",
    "author": "Marko K",
    "author_email": "",
    "download_url": "",
    "platform": null,
    "description": "# GlucoGraph\n\nThis project contains an application, which plots data exported \nfrom CGM (Continuous Glucode Monitoring) system. Currently only data exported \nfrom [xDrip](https://github.com/NightscoutFoundation/xDrip) is recognized by\nthis program.\n\n__IMPORTANT__: RESULTS OD THIS PROGRAM SHOULD NOT BE USED TO MAKE MEDICAL \nDECISIONS. THERE IS NO WARRANTY FOR THE PROGRAM. THE COPYRIGHT HOLDERS AND/OR \nOTHER PARTIES PROVIDE THE PROGRAM \u201cAS IS\u201d WITHOUT WARRANTY OF ANY KIND, \nEITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. \nTHE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. \nSHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY \nSERVICING, REPAIR OR CORRECTION.\n\nThe program shows the data in charts, which can be shown on screen or saved to\nfile. It is written in Python, so it should run in any environment, where\nPython runs.\n\nExample screenshot:\n\n![screenshot](doc/screenshot-1.png)\n\n\n\nInstallation\n---\n\n### 1. Install Python\n\nTo run this application, we need Python installed on your system. While it is\npreinstalled in most popular Linux distributions, we have to install it \non [Windows](https://docs.python.org/3/using/windows.html#windows-store) and\n[Mac](https://docs.python.org/3/using/mac.html).\n\n### 2. Install this program\n \nOpen shell (Terminal/Konsole/... on Linux, cmd or Power Shell on Windows)\nand type:\n\n    pip install --upgrade glucograph\n\n## Export data from xDrip\n\n\nFollow these steps:\n\na) Open xDrip on your phone and select the three dots menu in the top right corner.\n   Select _Import / Export features_ and then _Export database_. File with SQLite\n   database is created on your phone in _xdrip_ folder in internal storage. It is\n   usually named as `export<date>-<time>.zip`. \n\nb) Copy the exported database file to your computer\n   where you have installed _glucograph_. This can be done in several ways:\n   - connect your phone to computer with USB cable, and allow copying \n     files on the phone. The use file explorer to navigate to directory \n     dxrip on the phone and copy the zipped sqlite file to the computer.\n   - share the exported file via Google Drive, email, ...\n\nc) Unzip the file to get file with extension _sqlite_. \n\n## Create charts\n\nTo create charts open shell in directory with your exported database file and type:\n\n    glucograph [options] <name-of-exported-db-file>.sqlite\n\nThis application supports many configuration parameters like start date, number\nof days on a chart, ..., which can be specified on a command line when running\nthe program. To see all available options and parameters, run:\n\n    glucograph -h\n\n## Examples\n\nThis section demonstrates usage of the most useful parameters. In the \nfollowing examples we'll assume the name of our exported database file as\n`export20230117-221514.sqlite`.\n\n### Set units\n\nDefault units for blood glucose are `mmol/l`. To see values in `mg/dl` specify \noption `--mgdl`, for example:\n\n    glucograph --mgdl 2023-01-01 export20230117-221514.sqlite\n\n### Define start date\n\nSuppose we want to see data beginning with 1st Jan. Specify this with \nparameter `--start`:\n\n    glucograph --start 2023-01-01 export20230117-221514.sqlite\n\nThe date should be given in ISO format (yyyy-mm-dd).\n\n### Show only five days (five charts)\n\nSpecify the number of shown days with parameter `-d` or `--days`:\n\n    glucograph --days 5 --start 2023-01-01 export20230117-221514.sqlite\n\n### Specify range for Y axis and reference values other than defaults\n\nThis example sets min value on Y axis to 2 mmol/l and the maximum one to \n15 mmol/l. Reference values for low and high values of blood glucose are \nset to 3.9 mmol/l and 8.0 mmol/l respectively:\n\n    glucograph --ymin 2 --ymax 15 --ref_min 3.9 --ref_max 8 --start 2023-01-01 export20230117-221514.sqlite\n\nNote: If you specify option `--mgdl`, then all the above parameters must be \ngiven in mg/dl.\n\n### Print some statistics only\n\nThis parameter currently ignores all other parameters, like start day and \nnumber of days. It calculates statistics for all data in the database file.\n\n    glucograph --stats export20230117-221514.sqlite\n\n### Show also glucose measurements from finger pricks\n\nIf you control your CGM with finger pricks, but do not enter this data into\nCGM, and your blood glucose monitoring system supports exports of data, you can\nshow this data together with CGM values with option `--gmeter`:\n\n    glucograph --gmeter data/next_one-2023-01-09.csv export20230117-221514.sqlite\n\nData in the specified files must be given in CSV format, where each row\ncontains: \n\n    YYYY-mm-DD HH:MM:SS, <value>, <unit>\n\nfor example:\n\n    2022-08-15 21:25:56, 4.3, mmol/L\n    2022-08-16 22:18:02, 5.8, mmol/L\n    2022-08-17 20:13:33, 4.4, mmol/L\n\n### Show meals\n\nIf you are on a diet with meals at the same time each day, you can also show\nthese. First you have to create a file with description in the following format:\n\n    <hh:mm>, <color>, <description text>\n\nExample:\n\n    4:15, c, CS 30g\n    7:40, y, CS 30g\n\nFor available colors see \n[Matplotlib Color Formats](https://matplotlib.org/stable/tutorials/colors/colors.html).\n\n### Control visible data\n\nxDrip database contains also treatments and notes, if we enter them. To show\nthem in charts, we have to specify options `--show_treatments`, and `--show_calibrations`:\n\n    glucograph --show_treatments --show_calibrations export20230117-221514.sqlite\n\n### Save chart to file\n\nTo send chart to other people, we can save it to file. Only PDF format is \ncurrently supported:\n\n    glucograph --save --days 31 --start 2022-12-01 export20230117-221514.sqlite\n\nNumber of days may be greater in such case, because we are not limited with \nscreen size.  \n\nSpecial considerations\n---\n\nWhen showing treatments, the application treats text which contains \nonly float value as blood glucose value and draws it at Y position corresponding to the\nfloat value. However, no effort is currently made to convert this value to \nthe specified glucose units. This means that values given in different unit \nthan selected, will not be shown at correct Y position.\n\nNote: We use notes to record glucose value obtained with finger prick \nwhen CGM shows wrong value due to known \nreason, for example cold, pressure, ... It is not a good idea to calibrate CGM \nin such case, but it is useful to record the correct blood glucose.\n\n## Support\nIf you find a bug in the application or have an idea for a new feature, then \nplease open an issue in GitLab.\n\n## Roadmap\n\n1. Add simple GUI to set options.\n2. Add options to set colors.\n\n## Contributing\n\nIf you'd like to contribute to the project, please create a pull request. Note\nthat all code must be PEP-8 compliant.\n\n## License\n\nThis project is licensed under GPL v3.\n",
    "bugtrack_url": null,
    "license": "GPL v3",
    "summary": "This project contains an application, which plots data exported from CGM (Continuous Glucode Monitoring) system. Currently only data exported from xDrip (https://github.com/NightscoutFoundation/xDrip) is recognized by this program. THIS APPLICATION SHOULD NOT BE USED TO MAKE MEDICAL DECISIONS.",
    "version": "1.0.5",
    "split_keywords": [
        "glucose",
        "xdrip"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82d605425f418098fd66926a1ed918a2e4c72de100e1325a82a6542f8707d8ad",
                "md5": "be9fdd824bc3612766bb4cd1e44f7805",
                "sha256": "c15808f8fcf4c16b479a493444775a34722fdebedb97844d323db3a12a9aefd6"
            },
            "downloads": -1,
            "filename": "glucograph-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "be9fdd824bc3612766bb4cd1e44f7805",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 26091,
            "upload_time": "2023-01-28T21:47:06",
            "upload_time_iso_8601": "2023-01-28T21:47:06.640459Z",
            "url": "https://files.pythonhosted.org/packages/82/d6/05425f418098fd66926a1ed918a2e4c72de100e1325a82a6542f8707d8ad/glucograph-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-28 21:47:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "glucograph"
}
        
Elapsed time: 0.03441s