pydexcom


Namepydexcom JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
SummaryPython API to interact with Dexcom Share API
upload_time2024-07-21 03:42:18
maintainerNone
docs_urlNone
authorGage Benne
requires_python>=3.6
licenseMIT
keywords dexcom
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/pypi/v/pydexcom?style=flat-square)](https://pypi.org/project/pydexcom/)
[![Python versions](https://img.shields.io/pypi/pyversions/pytest.svg?style=flat-square)](https://pypi.org/project/pydexcom/)
[![Pre-commit](https://img.shields.io/github/actions/workflow/status/gagebenne/pydexcom/pre-commit.yaml?style=flat-square&label=pre-commit)](https://github.com/gagebenne/pydexcom/actions/workflows/pre-commit.yaml)
[![Tests](https://img.shields.io/github/actions/workflow/status/gagebenne/pydexcom/test.yaml?style=flat-square&label=tests)](https://github.com/gagebenne/pydexcom/actions/workflows/test.yaml)
[![Docs](https://img.shields.io/github/actions/workflow/status/gagebenne/pydexcom/docs.yaml?style=flat-square&label=docs)](https://gagebenne.github.io/pydexcom/pydexcom.html)

A simple Python API to interact with Dexcom Share service. Used to get *real-time* Dexcom CGM sensor data.

# Quick-start
1. Download the [Dexcom G7 / G6 / G5 / G4](https://www.dexcom.com/apps) mobile app and [enable the Share service](https://provider.dexcom.com/education-research/cgm-education-use/videos/setting-dexcom-share-and-follow).

The Dexcom Share service requires setup of at least one follower to enable the share service, but `pydexcom` will use your credentials, not the follower's

> [! CAUTION]
> With the release of the Dexcom G7, users are now able to authenticate with a mobile phone or email address. `pydexcom` currently does not support this, only legacy username-based authentication.
>
> While this is [being resolved](https://github.com/gagebenne/pydexcom/issues/55), please authenticate using your account ID. You can find your account ID by logging in to [uam1.dexcom.com](https://uam1.dexcom.com) for US users or [uam2.dexcom.com](https://uam2.dexcom.com) for users outside of the US. After logging in, note the UUID in the URL -- this is your account ID.

2. Install the `pydexcom` package.

 `pip3 install pydexcom`

3. Profit.

```python
>>> from pydexcom import Dexcom
>>> dexcom = Dexcom(account_id="account_id", password="password") # `ous=True` if outside of US
>>> dexcom = Dexcom(username="username", password="password") # legacy username accounts only
>>> glucose_reading = dexcom.get_current_glucose_reading()
>>> print(glucose_reading)
85

>>> glucose_reading.value
85

>>> glucose_reading.mmol_l
4.7

>>> glucose_reading.trend
4

>>> glucose_reading.trend_direction
'Flat'

>>> glucose_reading.trend_description
'steady'

>>> glucose_reading.trend_arrow
'→'

>>> print(bg.datetime)
2023-08-07 20:40:58

>>> glucose_reading.json
{'WT': 'Date(1691455258000)', 'ST': 'Date(1691455258000)', 'DT': 'Date(1691455258000-0400)', 'Value': 85, 'Trend': 'Flat'}
```

# Documentation

[https://gagebenne.github.io/pydexcom/pydexcom.html](https://gagebenne.github.io/pydexcom/pydexcom.html)

# Frequently Asked Questions

## Why is my password not working?

The Dexcom Share API understandably reports limited information during account validation. If anything is incorrect, the API simply reports back invalid password ( `pydexcom.errors.AccountErrorEnum` ). However, there could be many reasons you are getting this error:

1. Use the correct Dexcom Share API instance.

If you are located outside of the United States, be sure to set `ous=True` when initializing `Dexcom` .

2. Use your Dexcom Share credentials, not the follower's credentials.

Use the same credentials used to login to the Dexcom mobile application publishing the glucose readings.

3. Ensure you have at least one follower on Dexcom Share.

The Dexcom Share service requires setup of at least one follower to enable the service, as does this package.

4. Check whether your account credentials involve usernames or emails.

There are two account types the Dexcom Share API uses: legacy username-based accounts, and newer email-based accounts. Be sure to use the correct authentication method.

5. Use alpha-numeric passwords.

Some individuals have had problems with connecting when their Dexcom Share passwords are entirely numeric. If you have connection issues, try changing your password to something with a mix of numbers and letters.

7. Report it!

The Dexcom Share API sometimes changes. If you believe there is an issue with `pydexcom` , feel free to [create an issue](https://github.com/gagebenne/pydexcom/issues/new) if one has not been created yet already.

## Why not use the official Dexcom Developer API?

The official Dexcom API is a great tool to view trends, statistics, and day-by-day data, but is not suitable for real time fetching of glucose readings as it is a retrospective API.

## How can I let you know of suggestions or issues?

By all means submit a pull request if you have a feature you would like to see in the next release. Alternatively, you may [create an issue](https://github.com/gagebenne/pydexcom/issues/new) if you have a suggestion or bug you'd like to report.

## Where is this package being used?

Primarily this package is used in the [Home Assistant Dexcom integration](https://www.home-assistant.io/integrations/dexcom/), but it's fantastic to see community projects involving `pydexcom` :

* [Tracking glucose levels using a Raspberry Pi and e-ink display](https://www.tomshardware.com/news/raspberry-project-diy-dexcom-glucose-tracker)

* [Glucose Readings in a Terminal Prompt](https://harthoover.com/glucose-readings-in-a-terminal-prompt/)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pydexcom",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "dexcom",
    "author": "Gage Benne",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/96/09/4cd5b48f8ae8b30f3fc6af6806d160d559d51c2b9006ea2f3ed9e5d8ed2e/pydexcom-0.4.0.tar.gz",
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/pypi/v/pydexcom?style=flat-square)](https://pypi.org/project/pydexcom/)\n[![Python versions](https://img.shields.io/pypi/pyversions/pytest.svg?style=flat-square)](https://pypi.org/project/pydexcom/)\n[![Pre-commit](https://img.shields.io/github/actions/workflow/status/gagebenne/pydexcom/pre-commit.yaml?style=flat-square&label=pre-commit)](https://github.com/gagebenne/pydexcom/actions/workflows/pre-commit.yaml)\n[![Tests](https://img.shields.io/github/actions/workflow/status/gagebenne/pydexcom/test.yaml?style=flat-square&label=tests)](https://github.com/gagebenne/pydexcom/actions/workflows/test.yaml)\n[![Docs](https://img.shields.io/github/actions/workflow/status/gagebenne/pydexcom/docs.yaml?style=flat-square&label=docs)](https://gagebenne.github.io/pydexcom/pydexcom.html)\n\nA simple Python API to interact with Dexcom Share service. Used to get *real-time* Dexcom CGM sensor data.\n\n# Quick-start\n1. Download the [Dexcom G7 / G6 / G5 / G4](https://www.dexcom.com/apps) mobile app and [enable the Share service](https://provider.dexcom.com/education-research/cgm-education-use/videos/setting-dexcom-share-and-follow).\n\nThe Dexcom Share service requires setup of at least one follower to enable the share service, but `pydexcom` will use your credentials, not the follower's\n\n> [! CAUTION]\n> With the release of the Dexcom G7, users are now able to authenticate with a mobile phone or email address. `pydexcom` currently does not support this, only legacy username-based authentication.\n>\n> While this is [being resolved](https://github.com/gagebenne/pydexcom/issues/55), please authenticate using your account ID. You can find your account ID by logging in to [uam1.dexcom.com](https://uam1.dexcom.com) for US users or [uam2.dexcom.com](https://uam2.dexcom.com) for users outside of the US. After logging in, note the UUID in the URL -- this is your account ID.\n\n2. Install the `pydexcom` package.\n\n `pip3 install pydexcom`\n\n3. Profit.\n\n```python\n>>> from pydexcom import Dexcom\n>>> dexcom = Dexcom(account_id=\"account_id\", password=\"password\") # `ous=True` if outside of US\n>>> dexcom = Dexcom(username=\"username\", password=\"password\") # legacy username accounts only\n>>> glucose_reading = dexcom.get_current_glucose_reading()\n>>> print(glucose_reading)\n85\n\n>>> glucose_reading.value\n85\n\n>>> glucose_reading.mmol_l\n4.7\n\n>>> glucose_reading.trend\n4\n\n>>> glucose_reading.trend_direction\n'Flat'\n\n>>> glucose_reading.trend_description\n'steady'\n\n>>> glucose_reading.trend_arrow\n'\u2192'\n\n>>> print(bg.datetime)\n2023-08-07 20:40:58\n\n>>> glucose_reading.json\n{'WT': 'Date(1691455258000)', 'ST': 'Date(1691455258000)', 'DT': 'Date(1691455258000-0400)', 'Value': 85, 'Trend': 'Flat'}\n```\n\n# Documentation\n\n[https://gagebenne.github.io/pydexcom/pydexcom.html](https://gagebenne.github.io/pydexcom/pydexcom.html)\n\n# Frequently Asked Questions\n\n## Why is my password not working?\n\nThe Dexcom Share API understandably reports limited information during account validation. If anything is incorrect, the API simply reports back invalid password ( `pydexcom.errors.AccountErrorEnum` ). However, there could be many reasons you are getting this error:\n\n1. Use the correct Dexcom Share API instance.\n\nIf you are located outside of the United States, be sure to set `ous=True` when initializing `Dexcom` .\n\n2. Use your Dexcom Share credentials, not the follower's credentials.\n\nUse the same credentials used to login to the Dexcom mobile application publishing the glucose readings.\n\n3. Ensure you have at least one follower on Dexcom Share.\n\nThe Dexcom Share service requires setup of at least one follower to enable the service, as does this package.\n\n4. Check whether your account credentials involve usernames or emails.\n\nThere are two account types the Dexcom Share API uses: legacy username-based accounts, and newer email-based accounts. Be sure to use the correct authentication method.\n\n5. Use alpha-numeric passwords.\n\nSome individuals have had problems with connecting when their Dexcom Share passwords are entirely numeric. If you have connection issues, try changing your password to something with a mix of numbers and letters.\n\n7. Report it!\n\nThe Dexcom Share API sometimes changes. If you believe there is an issue with `pydexcom` , feel free to [create an issue](https://github.com/gagebenne/pydexcom/issues/new) if one has not been created yet already.\n\n## Why not use the official Dexcom Developer API?\n\nThe official Dexcom API is a great tool to view trends, statistics, and day-by-day data, but is not suitable for real time fetching of glucose readings as it is a retrospective API.\n\n## How can I let you know of suggestions or issues?\n\nBy all means submit a pull request if you have a feature you would like to see in the next release. Alternatively, you may [create an issue](https://github.com/gagebenne/pydexcom/issues/new) if you have a suggestion or bug you'd like to report.\n\n## Where is this package being used?\n\nPrimarily this package is used in the [Home Assistant Dexcom integration](https://www.home-assistant.io/integrations/dexcom/), but it's fantastic to see community projects involving `pydexcom` :\n\n* [Tracking glucose levels using a Raspberry Pi and e-ink display](https://www.tomshardware.com/news/raspberry-project-diy-dexcom-glucose-tracker)\n\n* [Glucose Readings in a Terminal Prompt](https://harthoover.com/glucose-readings-in-a-terminal-prompt/)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python API to interact with Dexcom Share API",
    "version": "0.4.0",
    "project_urls": null,
    "split_keywords": [
        "dexcom"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48a8db23b279ae7c8eb3b12b46dbc2a099fe2c4354e13e71cebe548d7be40876",
                "md5": "b662d12e77aa72fff604a1da921fa9ec",
                "sha256": "5ec5037d5f978efcbf7a7a0d53b6db92bc6fc5b2f00bd0536f076e233693e583"
            },
            "downloads": -1,
            "filename": "pydexcom-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b662d12e77aa72fff604a1da921fa9ec",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9063,
            "upload_time": "2024-07-21T03:42:16",
            "upload_time_iso_8601": "2024-07-21T03:42:16.758577Z",
            "url": "https://files.pythonhosted.org/packages/48/a8/db23b279ae7c8eb3b12b46dbc2a099fe2c4354e13e71cebe548d7be40876/pydexcom-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "96094cd5b48f8ae8b30f3fc6af6806d160d559d51c2b9006ea2f3ed9e5d8ed2e",
                "md5": "66f9ac1c92258b08d677582eb541aa77",
                "sha256": "22141686a0bb0451be8567efb6bee5ff952a62ef4261aa9bdc6ce455589245b9"
            },
            "downloads": -1,
            "filename": "pydexcom-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "66f9ac1c92258b08d677582eb541aa77",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 22188,
            "upload_time": "2024-07-21T03:42:18",
            "upload_time_iso_8601": "2024-07-21T03:42:18.088932Z",
            "url": "https://files.pythonhosted.org/packages/96/09/4cd5b48f8ae8b30f3fc6af6806d160d559d51c2b9006ea2f3ed9e5d8ed2e/pydexcom-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-21 03:42:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pydexcom"
}
        
Elapsed time: 0.83785s