
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
A simple Python API to interact with Dexcom Share service. Used to get real-time Dexcom CGM sensor data.
The Dexcom Share service requires setup of at least one follower to enable the share service, but pydexcom
will use your (or the dependent's) credentials, not the follower's or manager's.
pydexcom
package.pip install pydexcom
>>> from pydexcom import Dexcom
>>> dexcom = Dexcom(username="username", password="password") # `region="ous"` if outside of US, `region="jp"` if Japan
>>> dexcom = Dexcom(username="+11234567890", password="password") # phone number
>>> dexcom = Dexcom(username="user@email.com", password="password") # email address
>>> dexcom = Dexcom(account_id="12345678-90ab-cdef-1234-567890abcdef", password="password") # account ID (advanced)
>>> 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'}
https://gagebenne.github.io/pydexcom/pydexcom.html
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. Ensure your credentials are valid.
Validate your Dexcom account credentials by logging on to the Dexcom Account Management website for your region:
For users in the United States: uam1.dexcom.com. For users outside of the United States: uam2.dexcom.com. For users in the Asia-Pacific: uam.dexcom.jp.
2. Use the correct Dexcom Share API endpoint.
For users in the United States: use the default, or set region="us"
when initializing Dexcom
.
For users outside of the United States: be sure to set region="ous"
when initializing Dexcom
.
For users in Japan: be sure to set region="jp"
when initializing Dexcom
.
3. Ensure your username is correctly formatted.
Format phone numbers with a +
, your country code, then your phone number. For example, a US phone number of (123)-456-7890
would be supplied as a username="+11234567890"
.
4. 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.
5. 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.
6. Try using your account ID.
You can find your account ID by logging in to Dexcom Account Management website for your region. After logging in, note the UUID in the URL -- this is your account ID.
Format account IDs (UUIDs) with hyphens. For example, an account ID of 1234567890abcdef1234567890abcdef
found in the URL after logging in would be supplied as account_id="12345678-90ab-cdef-1234-567890abcdef"
.
7. 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.
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.
No, the Dexcom Stelo isn't compatible with the Dexcom Share service, so this package can't retrieve its readings.
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.
Primarily this package is used in the Home Assistant Dexcom integration, but it's fantastic to see community projects involving pydexcom
:
FAQs
Python API to interact with Dexcom Share API
We found that pydexcom demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.