glyco


Nameglyco JSON
Version 0.0.1rc1 PyPI version JSON
download
home_page
SummaryRead and analyse continuous glucose monitoring data
upload_time2023-09-18 10:01:07
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) [2022] [Ismail Elouafiq] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords glucose glyco cgm continuous glucose monitoring health healthcare
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Glyco - Analysing Continuous Glucose Data in Python

**|**   **Overview**   **|** [Examples](https://github.com/nidhog/glyco/blob/main/docs/examples.md) **|**

Glyco is a glucose data analysis Python library for glucose data analysis.

* ***Easy to setup:*** you can get started with glyco very fast. 
You can checkout the [Get started](Get%20started.ipynb) notebook for more.
* ***Easy to integrate:*** if you already have a workflow where you analyse glucose data. Glyco applies methods to pandas DataFrames, making it easy to integrate.

* ***Targeted for all kinds of glucose data:*** Glyco even handles glucose data for healthy individuals. Most of the metrics in CGM data are built based on CGM data for people with diabetes. This renders a lot of them useless when performing data analysis on healthy individuals (such as comparing the impact of meals and activities). Glyco has features to handle all types of glucose data, from all types of devices.

**Quick Example:**
```Python
import glyco as gl
# Read glucose file
df = gl.read_csv('examples/sample_glucose.csv')
# Plot glucose hourly trend
gl.plot_trend_by_hour(df)
```
![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/stats-glucose-hourtrend.png "Figure 0.a")
## The easiest library to manipulate glucose data
*Glyco does not add any more complexity.*

If you are familiar with pandas dataframes, glyco makes use of pandas dataframe and does not introduce any new concepts or abstractions.

This makes it easy to use and integrate with your current workflows.
Reading your glucose file into a dataframe in glyco is as easy as:
```Python
import glyco as gl

glucose = gl.read_csv(file_path='my_glucose_data.csv')
```
This returns a glucose dataframe, takes care of: pre-processing the timestamps and dates, cleaning missing data, making the curve smoother and converting units.
## What you can do with Glyco
Glyco provides a range of features for handling continuous glucose data, as shown in the figure below:
![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/basic-features.png "Figure 1.a")
![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/basic-features-example.png "Figure 1.b")

1. **Read and Write glucose data** Glyco handles data from different sources including CSV files (such as FreeStyleLibre or DexCom) and dataframes, and using this data is as simple as:

    ```Python
    glucose = gl.read_csv(file_path='my_glucose_data.csv')
    ```
    You can find more in the [glucose documentation](https://github.com/nidhog/glyco/blob/main/docs/concepts/glucose.md).
2. **Clean and Process glucose data** you do not need to worry about missing values, errors and outliers. Glyco handles different types of cleaning and processing, so you can focus on analysing the data.
3. **Plotting and visual analysis (EDA)** to easily explore glucose data, and aid you in understanding patterns and trends.

    ```Python
    gl.plot_glucose(glucose) # Where 'glucose' is the dataframe containing glucose
    gl.plot_trend_by_weekday(glucose)
    gl.plot_trend_by_hour(glucose)
    ```
4. **Calculate metrics and statistics**  for each day, or week. These metrics are targeted for analysing healthy individual data (not diagnosed with diabetes). These metrics range from *general statistics (mean, percentiles etc.) to more advanced metrics (area under the curve for a day)*. And it's as simple as:
    ```Python
    # get metrics for each day
    day_metrics = gl.get_metrics_by_day(glucose)
    day_metrics = gl.get_metrics_by_day(glucose)
    ```
    Which results in a dataframe containing metrics such as: mean glucose, maximum glucose, standard deviation, area under the curve and more. To learn more about metrics, feel free to look at the [metrics documentation](https://github.com/nidhog/glyco/blob/main/docs/concepts/metrics.md).

Most inputs and outputs in Glyco are pandas dataframes. This means that you can use features of pandas on along with the ones provided by glyco.

## More things you can do with glyco
Glyco can also aid you in more advanced tasks such as detecting meals, comparing the impact of different meals or activities or any type of event. 
![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/advanced-features.png "Figure 2.a" )
![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/advanced-features-example.png "Figure 2.b" )

1. **Automatically infer Meals, or activities**, or other events that impact glucose.
    ```Python
    # you can detect events from variations in glucose
    events = gl.get_events_from_variations(glucose)
    ```
    Different methods are used for infering events. More on this in the [meals and events documentation](https://github.com/nidhog/glyco/blob/main/docs/concepts/events_and_meals.md).
2. **Provide events and match them to the glucose data** and analyse them to see how they impact glucose.
    ```Python
    # you can provide a list or dataframe that contains the event times
    events = gl.get_events(event_times)
    ```
    You can even get the events from a folder of pictures. More on this in the [meals and events documentation](https://github.com/nidhog/glyco/blob/main/docs/concepts/events_and_meals.md)).
3. **Advanced analysis of events**, including metrics for meals or events and how they impact glucose. As well as ranking meals and more, to further aid in understanding the glucose data.

## Limitations
* The metric calculations for days assumes the device timezone is the user's timezone.

> ***Disclaimer*** Glyco is not a medical product and shall not be used to diagnose, treat or evaluate any medical conditions.
For more on the intended use and indications of use please read the [healthcare considerations document](https://github.com/nidhog/glyco/blob/main/docs/extra/healthcare.md).

## Built on the shoulders of giants
Glyco is built using the following libraries:
* Pandas and Numpy.
* Matplotlib and Seaborn.
* Rich for beautiful text displays.

> [Contact the author here](https://ismail.bio/about)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "glyco",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "glucose,glyco,cgm,continuous glucose monitoring,health,healthcare",
    "author": "",
    "author_email": "Ismail Elouafiq <contact@ismail.bio>",
    "download_url": "https://files.pythonhosted.org/packages/40/38/3f263df888a93209513a9f33abe62d2d8aa6a16ba9174c822b92d6e7340a/glyco-0.0.1rc1.tar.gz",
    "platform": null,
    "description": "# Glyco - Analysing Continuous Glucose Data in Python\n\n**|** &nbsp; **Overview** &nbsp; **|** [Examples](https://github.com/nidhog/glyco/blob/main/docs/examples.md) **|**\n\nGlyco is a glucose data analysis Python library for glucose data analysis.\n\n* ***Easy to setup:*** you can get started with glyco very fast. \nYou can checkout the [Get started](Get%20started.ipynb) notebook for more.\n* ***Easy to integrate:*** if you already have a workflow where you analyse glucose data. Glyco applies methods to pandas DataFrames, making it easy to integrate.\n\n* ***Targeted for all kinds of glucose data:*** Glyco even handles glucose data for healthy individuals. Most of the metrics in CGM data are built based on CGM data for people with diabetes. This renders a lot of them useless when performing data analysis on healthy individuals (such as comparing the impact of meals and activities). Glyco has features to handle all types of glucose data, from all types of devices.\n\n**Quick Example:**\n```Python\nimport glyco as gl\n# Read glucose file\ndf = gl.read_csv('examples/sample_glucose.csv')\n# Plot glucose hourly trend\ngl.plot_trend_by_hour(df)\n```\n![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/stats-glucose-hourtrend.png \"Figure 0.a\")\n## The easiest library to manipulate glucose data\n*Glyco does not add any more complexity.*\n\nIf you are familiar with pandas dataframes, glyco makes use of pandas dataframe and does not introduce any new concepts or abstractions.\n\nThis makes it easy to use and integrate with your current workflows.\nReading your glucose file into a dataframe in glyco is as easy as:\n```Python\nimport glyco as gl\n\nglucose = gl.read_csv(file_path='my_glucose_data.csv')\n```\nThis returns a glucose dataframe, takes care of: pre-processing the timestamps and dates, cleaning missing data, making the curve smoother and converting units.\n## What you can do with Glyco\nGlyco provides a range of features for handling continuous glucose data, as shown in the figure below:\n![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/basic-features.png \"Figure 1.a\")\n![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/basic-features-example.png \"Figure 1.b\")\n\n1. **Read and Write glucose data** Glyco handles data from different sources including CSV files (such as FreeStyleLibre or DexCom) and dataframes, and using this data is as simple as:\n\n    ```Python\n    glucose = gl.read_csv(file_path='my_glucose_data.csv')\n    ```\n    You can find more in the [glucose documentation](https://github.com/nidhog/glyco/blob/main/docs/concepts/glucose.md).\n2. **Clean and Process glucose data** you do not need to worry about missing values, errors and outliers. Glyco handles different types of cleaning and processing, so you can focus on analysing the data.\n3. **Plotting and visual analysis (EDA)** to easily explore glucose data, and aid you in understanding patterns and trends.\n\n    ```Python\n    gl.plot_glucose(glucose) # Where 'glucose' is the dataframe containing glucose\n    gl.plot_trend_by_weekday(glucose)\n    gl.plot_trend_by_hour(glucose)\n    ```\n4. **Calculate metrics and statistics**  for each day, or week. These metrics are targeted for analysing healthy individual data (not diagnosed with diabetes). These metrics range from *general statistics (mean, percentiles etc.) to more advanced metrics (area under the curve for a day)*. And it's as simple as:\n    ```Python\n    # get metrics for each day\n    day_metrics = gl.get_metrics_by_day(glucose)\n    day_metrics = gl.get_metrics_by_day(glucose)\n    ```\n    Which results in a dataframe containing metrics such as: mean glucose, maximum glucose, standard deviation, area under the curve and more. To learn more about metrics, feel free to look at the [metrics documentation](https://github.com/nidhog/glyco/blob/main/docs/concepts/metrics.md).\n\nMost inputs and outputs in Glyco are pandas dataframes. This means that you can use features of pandas on along with the ones provided by glyco.\n\n## More things you can do with glyco\nGlyco can also aid you in more advanced tasks such as detecting meals, comparing the impact of different meals or activities or any type of event. \n![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/advanced-features.png \"Figure 2.a\" )\n![image](https://raw.githubusercontent.com/nidhog/glyco/main/docs/images/advanced-features-example.png \"Figure 2.b\" )\n\n1. **Automatically infer Meals, or activities**, or other events that impact glucose.\n    ```Python\n    # you can detect events from variations in glucose\n    events = gl.get_events_from_variations(glucose)\n    ```\n    Different methods are used for infering events. More on this in the [meals and events documentation](https://github.com/nidhog/glyco/blob/main/docs/concepts/events_and_meals.md).\n2. **Provide events and match them to the glucose data** and analyse them to see how they impact glucose.\n    ```Python\n    # you can provide a list or dataframe that contains the event times\n    events = gl.get_events(event_times)\n    ```\n    You can even get the events from a folder of pictures. More on this in the [meals and events documentation](https://github.com/nidhog/glyco/blob/main/docs/concepts/events_and_meals.md)).\n3. **Advanced analysis of events**, including metrics for meals or events and how they impact glucose. As well as ranking meals and more, to further aid in understanding the glucose data.\n\n## Limitations\n* The metric calculations for days assumes the device timezone is the user's timezone.\n\n> ***Disclaimer*** Glyco is not a medical product and shall not be used to diagnose, treat or evaluate any medical conditions.\nFor more on the intended use and indications of use please read the [healthcare considerations document](https://github.com/nidhog/glyco/blob/main/docs/extra/healthcare.md).\n\n## Built on the shoulders of giants\nGlyco is built using the following libraries:\n* Pandas and Numpy.\n* Matplotlib and Seaborn.\n* Rich for beautiful text displays.\n\n> [Contact the author here](https://ismail.bio/about)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) [2022] [Ismail Elouafiq]  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Read and analyse continuous glucose monitoring data",
    "version": "0.0.1rc1",
    "project_urls": {
        "Author": "https://ismail.bio",
        "Homepage": "https://github.com/nidhog/glyco",
        "Visual": "https://ismail.bio/glyco"
    },
    "split_keywords": [
        "glucose",
        "glyco",
        "cgm",
        "continuous glucose monitoring",
        "health",
        "healthcare"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "916648d2947b1a5a8c3b377554b500afec53af44a56726c88f737517736135ef",
                "md5": "7a6c052fed833cf35fbdf7b424f3c369",
                "sha256": "3aef0438d37c51ba0690e7438f18a4b459c3f7e640259230516c916eb252b24d"
            },
            "downloads": -1,
            "filename": "glyco-0.0.1rc1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7a6c052fed833cf35fbdf7b424f3c369",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 23794,
            "upload_time": "2023-09-18T10:01:06",
            "upload_time_iso_8601": "2023-09-18T10:01:06.038331Z",
            "url": "https://files.pythonhosted.org/packages/91/66/48d2947b1a5a8c3b377554b500afec53af44a56726c88f737517736135ef/glyco-0.0.1rc1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "40383f263df888a93209513a9f33abe62d2d8aa6a16ba9174c822b92d6e7340a",
                "md5": "a2a98b3283423a60e07a84936f98be20",
                "sha256": "aaf9f75bbf3acba4dff023b388de6e6c53426fbbb4bd092a2e326a206d67e54e"
            },
            "downloads": -1,
            "filename": "glyco-0.0.1rc1.tar.gz",
            "has_sig": false,
            "md5_digest": "a2a98b3283423a60e07a84936f98be20",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 24946,
            "upload_time": "2023-09-18T10:01:07",
            "upload_time_iso_8601": "2023-09-18T10:01:07.995001Z",
            "url": "https://files.pythonhosted.org/packages/40/38/3f263df888a93209513a9f33abe62d2d8aa6a16ba9174c822b92d6e7340a/glyco-0.0.1rc1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-18 10:01:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nidhog",
    "github_project": "glyco",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "glyco"
}
        
Elapsed time: 0.11885s