Python API to interact with Dexcom Share API
Project description
A simple Python API to interact with Dexcom Share service. Used to get real-time Dexcom CGM sensor data.
Quickstart
- Download the Dexcom G6 / G5 / G4 mobile app and enable the Share service.
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
- Install the
pydexcom
package.
pip3 install pydexcom
- Profit.
>>> from pydexcom import Dexcom
>>> dexcom = Dexcom("username", "password") # `ous=True` if outside of US
>>> 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
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:
- Use the correct Dexcom Share API instance.
If you are located outside of the United States, be sure to set ous=True
when intializing Dexcom
.
- 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.
- 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.
- 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.
- 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.
- Report it!
The Dexcom Share API sometimes changes. If you believe there is an issue with pydexcom
, feel free to create an issue 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 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, but it's fantastic to see community projects involving pydexcom
:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pydexcom-0.3.2.tar.gz
.
File metadata
- Download URL: pydexcom-0.3.2.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc557a279da993f527456c6e7c907e72b87376da98520b6b1cbf30b8e78ee19b |
|
MD5 | 34dfb7879d01d0f634e3c58f95ee4a7b |
|
BLAKE2b-256 | 6316c361b8e6707912f2fbe059770e97f55f8a4853d3abfb12fa490ef525aba6 |
File details
Details for the file pydexcom-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: pydexcom-0.3.2-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a3f1674342590943cbddfd1625693994d6b3d15de94a5344a6459065d925766 |
|
MD5 | 7eb2ba574c64d38612767cd651676776 |
|
BLAKE2b-256 | 32bca5465e84da0461f526b81d5eaa8b8dfa343bc96cbb33d88dc2c1b8327064 |